首页

通过OpenCms导出报出" java.net.ConnectException: Connection refused"问题

标签:opencms,静态导出,ConnectException,模板发布,Connection refused,CmsAfterPublishStaticExportHandler,404,静态发布     发布时间:2016-01-18   

一、问题现象

通过OpenCms将栏目内容对应的模板绑定好之后,进行发布操作(如下图所示),报出“ ... Exception java.net.ConnectException: Connection refused”异常

通过OpenCms导出报出" java.net.ConnectException: Connection refused"问题

报错日志,详情如下:

( 1 / 380 )导出_/system/workplace/commons/style/onlinehelp.css...异常_java.net.ConnectException: Connection refused@b@at java.net.PlainSocketImpl.socketConnect(Native Method)@b@at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)@b@at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)@b@at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)@b@at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)@b@at java.net.Socket.connect(Socket.java:579)@b@at java.net.Socket.connect(Socket.java:528)@b@at sun.net.NetworkClient.doConnect(NetworkClient.java:180)@b@at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)@b@at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)@b@at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)@b@at sun.net.www.http.HttpClient.New(HttpClient.java:308)@b@at sun.net.www.http.HttpClient.New(HttpClient.java:326)@b@at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996)@b@at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)@b@at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850)@b@at org.opencms.staticexport.CmsAfterPublishStaticExportHandler.exportTemplateResource(CmsAfterPublishStaticExportHandler.java:576)@b@at org.opencms.staticexport.CmsAfterPublishStaticExportHandler.exportTemplateResources(CmsAfterPublishStaticExportHandler.java:676)@b@at org.opencms.staticexport.CmsAfterPublishStaticExportHandler.doExportAfterPublish(CmsAfterPublishStaticExportHandler.java:161)@b@at org.opencms.staticexport.CmsStaticExportManager.exportFullStaticRender(CmsStaticExportManager.java:720)@b@at org.opencms.workplace.tools.database.CmsStaticExportThread.run(CmsStaticExportThread.java:76)

二、解决步骤

1. 通过上面异常抛出日志(..CmsAfterPublishStaticExportHandler.java:576..),可以看到是因为http访问端口或地址不正确造成的Socket连接异常,如下图找到相关的配置

通过OpenCms导出报出" java.net.ConnectException: Connection refused"问题

2. 如上图,找到opencms部署目录下WEB-INF/config/opencms-importexport.xml的相关配置位置,将地址端口改正确

3.重启tomcat服务,再重新发布问题就正常(能报出404提示)

<<热门下载>>