Unable to load configuration. - include file...+java/net/PlainSocketImpl.java:177:-1

2016-1-4 22:24:46 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: F:\software\jdk1.6.0_10\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;F:\software\jdk1.6.0_10\jre\bin;F:/software/jdk1.6.0_10/bin/../jre/bin/client;F:/software/jdk1.6.0_10/bin/../jre/bin;F:/software/jdk1.6.0_10/bin/../jre/lib/i386;C:\Program Files (x86)\Common Files\NetSarang;C:\CygwinPortable\App\Cygwin\bin;D:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;F:\software\jdk1.6.0_10\bin;F:\software\apache-maven-3.0.5\bin;E:\android\sdk\tools;E:\android\sdk\platform-tools;F:\software\eclipse;
2016-1-4 22:24:46 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'uriEncoding' to 'utf-8' did not find a matching property.
2016-1-4 22:24:46 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:struts2' did not find a matching property.
2016-1-4 22:24:46 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-9000"]
2016-1-4 22:24:46 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
2016-1-4 22:24:46 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1165 ms
2016-1-4 22:24:46 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
2016-1-4 22:24:46 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.56
2016-1-4 22:24:49 org.apache.tomcat.websocket.server.WsSci onStartup
信息: JSR 356 WebSocket (Java WebSocket 1.0) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSocket JARs from $CATALINA_HOME/lib or add the WebSocket JARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API will be available.
2016-1-4 22:24:49 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-default.xml]
2016-1-4 22:24:50 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-plugin.xml]
2016-1-4 22:24:50 com.opensymphony.xwork2.util.logging.jdk.JdkLogger error
严重: Dispatcher initialization failed
Unable to load configuration. - include - file:/F:/software/apache-tomcat-7.0.56/webapps/struts2/WEB-INF/classes/struts.xml:5:35
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
    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.initFilter(ApplicationFilterConfig.java:279)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4830)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5510)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
Caused by: Unable to load file:/F:/software/apache-tomcat-7.0.56/webapps/struts2/WEB-INF/classes/struts-login.xml - include - file:/F:/software/apache-tomcat-7.0.56/webapps/struts2/WEB-INF/classes/struts.xml:5:35
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:896)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:945)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:143)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:110)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:168)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
    ... 17 more
Caused by: struts.apache.org - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 177 - java/net/PlainSocketImpl.java:177:-1
    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:893)
    ... 22 more
Caused by: java.net.UnknownHostException: struts.apache.org
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at java.net.Socket.connect(Socket.java:469)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
    at sun.net.www.http.HttpClient.New(HttpClient.java:306)
    at sun.net.www.http.HttpClient.New(HttpClient.java:323)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:790)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:731)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:656)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:979)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1282)
    at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1192)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1089)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1002)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:113)
    ... 23 more
2016-1-4 22:24:50 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter Struts2
Unable to load configuration. - include - file:/F:/software/apache-tomcat-7.0.56/webapps/struts2/WEB-INF/classes/struts.xml:5:35
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)
    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.initFilter(ApplicationFilterConfig.java:279)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4830)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5510)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
Caused by: Unable to load configuration. - include - file:/F:/software/apache-tomcat-7.0.56/webapps/struts2/WEB-INF/classes/struts.xml:5:35
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
    ... 15 more
Caused by: Unable to load file:/F:/software/apache-tomcat-7.0.56/webapps/struts2/WEB-INF/classes/struts-login.xml - include - file:/F:/software/apache-tomcat-7.0.56/webapps/struts2/WEB-INF/classes/struts.xml:5:35
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:896)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:945)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:143)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:110)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:168)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
    ... 17 more
Caused by: struts.apache.org - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 177 - java/net/PlainSocketImpl.java:177:-1
    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:893)
    ... 22 more
Caused by: java.net.UnknownHostException: struts.apache.org
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at java.net.Socket.connect(Socket.java:469)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
    at sun.net.www.http.HttpClient.New(HttpClient.java:306)
    at sun.net.www.http.HttpClient.New(HttpClient.java:323)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:790)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:731)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:656)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:979)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1282)
    at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1192)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1089)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1002)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
    at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:113)
    ... 23 more
2016-1-4 22:24:50 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
2016-1-4 22:24:50 org.apache.catalina.core.StandardContext startInternal
严重: Context [/struts2] startup failed due to previous errors
2016-1-4 22:24:50 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\software\apache-tomcat-7.0.56\webapps\docs
2016-1-4 22:24:50 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\software\apache-tomcat-7.0.56\webapps\docs has finished in 322 ms
2016-1-4 22:24:50 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\software\apache-tomcat-7.0.56\webapps\examples
2016-1-4 22:24:51 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2016-1-4 22:24:51 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2016-1-4 22:24:51 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@1eaf705')
2016-1-4 22:24:51 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\software\apache-tomcat-7.0.56\webapps\examples has finished in 790 ms
2016-1-4 22:24:51 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\software\apache-tomcat-7.0.56\webapps\ROOT
2016-1-4 22:24:51 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\software\apache-tomcat-7.0.56\webapps\ROOT has finished in 164 ms
2016-1-4 22:24:51 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-9000"]
2016-1-4 22:24:51 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
2016-1-4 22:24:51 org.apache.catalina.startup.Catalina start

信息: Server startup in 4809 ms


问题场景:

A类问题.struts.xml分模块开发,struts.xml通过include引入子模块struts-login.xml,两者文档配置struts-2.xxx.dtd编号不一致导致启动报错

struts.xml 文档配置

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
    "http://struts.apache.org/dtds/struts-2.1.7.dtd" >

struts-login.xml为子模块文档配置

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.1.//EN"
    "http://struts.apache.org/dtds/struts-2.1.dtd">

B类问题.未联网情况下,启动也会出现报错

解决办法:

1.如果有子模块,父子模块struts.xml的配置文件struts-xxx.dtd保持一致,我的都改成struts-2.1.7.dtd就能成功启动

2.如果想在未联网状态开发,保持与struts2-core-xxx.jar下的struts-default.xml下的一致就行

总结:1.有网时,可以设置成红色方框的任意一个版本号,或与struts-default.xml中一致,父子保持一致,都能成功启动

             2.无网时需与struts-default.xml一致



阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yhl_jxy/article/details/50458951
个人分类: ---Struts2
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭