问题描述
- Java的框架SSH整合的项目,项目启动时总是会报一个莫名其妙的错误?
-
Unable to load configuration. - [unknown location]Caused by: Unable to load configuration. - [unknown location]
Caused by: Unable to load jar:file:/D:/mars-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/vvvvvvvvvvv/WEB-INF/lib/struts2-spring-plugin-2.3.15.3.jar!/struts-plugin.xml - [unknown location]
Caused by: Connection timed out: connect - [unknown location]
Caused by: java.net.ConnectException: Connection timed out: connect
个人分析应该不是jar包冲突的问题,因为项目以前是可以正常运行的,以前出过一次这样的问题,但是放了两天之后再运行又可以正常运行了。。。。现在又出现了这样的问题,百度上有人说是因为查询次数太多导致无法查询,但是如代码所示,无论是在junit测试类中还是在spring容器刚刚初始化完成利用监听器立即查询所有权限的功能,均可以正常访问到数据库,所以应该也不是c3p0数据库连接池的原因,整的我现在也不知道到底是什么问题。。求指教。
解决方案
以下整个的错误信息:
以下是整个的异常信息:
三月 25, 2016 4:28:04 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:vvvvvvvvvvv' did not find a matching property.
三月 25, 2016 4:28:04 下午 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:Javajdk1.7.0_07bin;C:WindowsSunJavabin;C:Windowssystem32;C:Windows;D:/Java/jdk1.7.0_07/bin/../jre/bin/server;D:/Java/jdk1.7.0_07/bin/../jre/bin;D:/Java/jdk1.7.0_07/bin/../jre/lib/amd64;D:Javajdk1.7.0_07bin;C:ProgramDataOracleJavajavapath;D:apache-tomcat-6.0.16bin;D:oracleproduct10.2.0client_1bin;D:oracleproduct10.2.0db_1bin;C:Program FilesBroadcomBroadcom 802.11 Network Adapter;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program FilesWIDCOMMBluetooth Software;C:Program FilesWIDCOMMBluetooth Softwaresyswow64;D:Mysqlbin;F:SDKsandroid-sdkplatform-tools;C:Program Files (x86)Windows Kits8.1Windows Performance Toolkit;C:Program FilesMicrosoft SQL Server110ToolsBinn;C:Program FilesMicrosoft SQL Server120ToolsBinn;C:Program Files (x86)Microsoft SDKsTypeScript1.0;D:Rationalcommon;C:Program Files (x86)Windows LiveShared;D:eclipse-mars1eclipse;;.
三月 25, 2016 4:28:04 下午 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8989
三月 25, 2016 4:28:04 下午 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 417 ms
三月 25, 2016 4:28:04 下午 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
三月 25, 2016 4:28:04 下午 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
三月 25, 2016 4:28:05 下午 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has been ignored.
三月 25, 2016 4:28:05 下午 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Hibernate:
select
right0_.ID as ID1_3_,
right0_.RIGHTNAME as RIGHTNAM2_3_,
right0_.RIGHTURL as RIGHTURL3_3_,
right0_.RIGHTDESC as RIGHTDES4_3_,
right0_.RIGHTCODE as RIGHTCOD5_3_,
right0_.RIGHTPOS as RIGHTPOS6_3_,
right0_.COMMON as COMMON7_3_
from
RIGHTS right0_
三月 25, 2016 4:28:29 下午 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - [unknown location]
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: Unable to load configuration. - [unknown location]
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
... 20 more
Caused by: Unable to load jar:file:/D:/mars-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/vvvvvvvvvvv/WEB-INF/lib/struts2-spring-plugin-2.3.15.3.jar!/struts-plugin.xml - [unknown location]
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:909)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:154)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:121)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:179)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
... 22 more
Caused by: Connection timed out: connect - [unknown location]
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:904)
... 26 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:378)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:473)
at sun.net.www.http.HttpClient.(HttpClient.java:203)
at sun.net.www.http.HttpClient.New(HttpClient.java:290)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:995)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:931)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:849)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:632)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1270)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1237)
at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:260)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1153)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1049)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:962)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:113)
... 27 more
三月 25, 2016 4:28:29 下午 org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
三月 25, 2016 4:28:29 下午 org.apache.catalina.core.StandardContext start
SEVERE: Context [/vvvvvvvvvvv] startup failed due to previous errors
三月 25, 2016 4:28:29 下午 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
三月 25, 2016 4:28:30 下午 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8989
三月 25, 2016 4:28:30 下午 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
三月 25, 2016 4:28:30 下午 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/23 config=null
三月 25, 2016 4:28:30 下午 org.apache.catalina.startup.Catalina start
INFO: Server startup in 25280 ms
解决方案二:
同样的问题,参见http://blog.csdn.net/chexitianxia/article/details/6746345
解决方案三:
比如数据连接池 有的 连接没有释放。
解决方案四:
首先,如果是启动时出错,要么是配置问题,要么是服务器问题,要么是数据库问题,优先考虑前者,一点一点按照ssh项目启动逻辑找问题,其次是服务器中的部署项目是不是出问题了,移除并重新部署,最后也是可能性最小的,重启数据库
解决方案五:
从你的log上看,最开始的报错不是这个吗?Caused by: Unable to load jar:file:/D:/mars-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/vvvvvvvvvvv/WEB-INF/lib/struts2-spring-plugin-2.3.15.3.jar!/struts-plugin.xml - [unknown location]那就应该是你的那个jar包的问题吧。。。你换一个低版本的struts2-spring-plugin.jar呢?我目前用的2.3.8版本的,至少是配置上没有问题。。。