三大框架常见错

Unable  to  load  configuration.  -  [unknown  location]
     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.FilterDispatcher.init(FilterDispatcher.java: 190 )
     at 


解决问题步骤:

第一,看看是否导入Junit4这个单元测试包没,没有导入再运行。否则进入第二步
第二,jar包冲突,检查项目中的jar包是否同时有 
xerce.jar和xml-apis.jar这两个jar包,有的话删除xerce.jar 
第三,缺了包,检查struts.xml中是否有配置
有的话看看项目中是否有引入struts2-spring-plugin-2.1.6.jar,没有的话引入即可


第二个:Line: 177 - java/net/PlainSocketImpl.java:177:-1

这个问题只要你机子联网就可以跑起来,但是你一没网就报错了..具体如下:
2010-1-24 21:51:42 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:struts2' did not find a matching property.
2010-1-24 21:51:42 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:\jdk.1.6\Java\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;F:/jdk.1.6/Java/bin/../jre/bin/client;F:/jdk.1.6/Java/bin/../jre/bin;F:\jdk.1.6\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;C:\Program Files\StormII\Codec;C:\Program Files\StormII
2010-1-24 21:51:43 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2010-1-24 21:51:43 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2063 ms
2010-1-24 21:51:43 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-1-24 21:51:43 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.16
2010-1-24 21:51:45 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-default.xml]
2010-1-24 21:51:45 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-plugin.xml]
2010-1-24 21:51:45 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 177 - java/net/PlainSocketImpl.java:177:-1
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:835)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
 at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
 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.<init>(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:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
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:123)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)
 ... 25 more


解决办法:解决不联网无法启动struts2问题

*将struts.xml中的声明部分
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD StrutsConfiguration 2.1//EN"
    "http://struts.apache.org/dtds/struts-2.1.dtd">


替换为 在struts2-core-2.xxx.jar包中struts-default.xml的文件声明
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD StrutsConfiguration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

****说白了也就是说要保持一致!!


你可能感兴趣的:(框架,-,line,三大框架的错误,javanetPl,177)