Gmane
From: Chirouze Olivier <olivier.chirouze <at> volvo.com>
Subject: Re: Error during static export
Newsgroups: gmane.comp.cms.opencms.devel
Date: 2008-08-06 08:33:09 GMT (10 weeks, 12 hours and 31 minutes ago)

Hi Jehan,
 
I played a lot with the static export these days ;-)
 
I got the same error and found the explanation and solution!!
 
What I understood is that when doing a static export, OpenCms has 2 behaviours (gurus, correct me if I understood wrong):
- for non-template files, it just copies the file to filesystem
- for template files, the files need to be "compiled" against a template. And what's the easiest way to get the compiled file?... to request it! So OpenCms just connects to itself to query the file throught HTTP, as a web browser would do.

To achieve this, OpenCms needs to build the request URL. This URL is based on exporturl tag. You will see that in your case, the url is not correct because the default value is set for Tomcat. You need to replace 127.0.0.1:8080 with your actual server host (probably something around 127.0.0.1:9080, just check how you access OpenCms with your browser).
 
That brings me to a note to OpenCms developpers: why should the servername / port be hardcoded in the file, while OpenCms could very easily get its own runtime servername programatically?
 
Olivier

Olivier CHIROUZE
I&0 Infrastructure
Volvo Information Technology

 

From: opencms-dev-bounces <at> opencms.org [mailto:opencms-dev-bounces <at> opencms.org] On Behalf Of Jaleel, Jehan
Sent: 29 July 2008 16:15
To: opencms-dev <at> opencms.org
Subject: [opencms-dev] Error during static export

Hi all,

           When I try the opencms static export feature, I am getting the following error…

 

Exception java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:389)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:250)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:237)
at java.net.Socket.connect(Socket.java:543)
at java.net.Socket.connect(Socket.java:493)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:403)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:521)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:246)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:337)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:822)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:774)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:699)
at org.opencms.staticexport.CmsAfterPublishStaticExportHandler.exportTemplateResource(CmsAfterPublishStaticExportHandler.java:436)
at org.opencms.staticexport.CmsAfterPublishStaticExportHandler.exportTemplateResources(CmsAfterPublishStaticExportHandler.java:507)
at org.opencms.staticexport.CmsAfterPublishStaticExportHandler.doExportAfterPublish(CmsAfterPublishStaticExportHandler.java:166)
at org.opencms.staticexport.CmsStaticExportManager.exportFullStaticRender(CmsStaticExportManager.java:715)
at org.opencms.workplace.tools.database.CmsStaticExportThread.run(CmsStaticExportThread.java:84)

 

Does anyone what is the cause? I did not change the opencms-importexport.xml file. It still has all the default values….

 

<staticexport enabled="true">

                        <staticexporthandler>org.opencms.staticexport.CmsOnDemandStaticExportHandler</staticexporthandler>

                        <linksubstitutionhandler>org.opencms.staticexport.CmsDefaultLinkSubstitutionHandler</linksubstitutionhandler>                       

                        <exportpath>export</exportpath>

                        <exportworkpath>temp</exportworkpath>

                        <exportbackups>2</exportbackups>

                        <defaultpropertyvalue>false</defaultpropertyvalue>

                        <defaultsuffixes>

                                    <suffix key=".jpg"/>

                                    <suffix key=".gif"/>

                                    <suffix key=".png"/>

                                    <suffix key=".doc"/>

                                    <suffix key=".xls"/>

                                    <suffix key=".ppt"/>

                                    <suffix key=".pdf"/>

                                    <suffix key=".txt"/>

                                    <suffix key=".css"/>

                                    <suffix key=".zip"/>

                                    <suffix key=".swf"/>

                        </defaultsuffixes>

                        <rendersettings>

                                    <rfs-prefix>${CONTEXT_NAME}/export</rfs-prefix>

                                    <vfs-prefix>${CONTEXT_NAME}${SERVLET_NAME}</vfs-prefix>

                                    <userelativelinks>false</userelativelinks>                                   

                                    <exporturl>http://127.0.0.1:8080${CONTEXT_NAME}/handle404</exporturl>

                                    <plainoptimization>true</plainoptimization>

                                    <testresource uri="/system/shared/page.dtd"/>

                                    <resourcestorender>

                                                <regex>/sites/.*</regex>

                                                <!--<regex>/system/workplace/commons/style/.*</regex>

                                                <regex>/system/galleries/.*</regex>

                                                <regex>/system/modules/.*/resources/.*</regex>-->

                                    </resourcestorender>

                        </rendersettings>

            </staticexport>

 

The only thing is that I am running opencms on my local machine. I am running it on Webpshere which is on a separate server.

 

 

Thanks,

Jehan


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev