-1
SEVERE: Exception starting filter struts2
  Unable to load configuration. - bean -  jar:file:/C:/Users/vaio/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/StrutsCRUD/WEB-INF/lib/struts2-core-2.3.4.1.jar!/struts-default.xml:29:72
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:450)   at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
    at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
    at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
    at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)    at
java.util.concurrent.FutureTask.run(Unknown Source)     at
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)   at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  at
java.lang.Thread.run(Unknown Source) Caused by: Unable to load
configuration. - bean -
jar:file:/C:/Users/vaio/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/StrutsCRUD/WEB-INF/lib/struts2-core-2.3.4.1.jar!/struts-default.xml:29:72
    at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
    at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)     at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)
    ... 16 more Caused by: Unable to load bean: type:
class:com.opensymphony.xwork2.ObjectFactory - bean -
jar:file:/C:/Users/vaio/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/StrutsCRUD/WEB-INF/lib/struts2-core-2.3.4.1.jar!/struts-default.xml:29:72
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:243)
    at
org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
    at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:210)
    at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
    ... 18 more Caused by: Bean type class
com.opensymphony.xwork2.ObjectFactory with the name xwork has already
been loaded by bean -
jar:file:/C:/apache-tomcat-7.0.25-windows-x86/apache-tomcat-7.0.25/lib/struts2-core-2.3.4.1.jar!/struts-default.xml:29:72
- bean - jar:file:/C:/Users/vaio/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/StrutsCRUD/WEB-INF/lib/struts2-core-2.3.4.1.jar!/struts-default.xml:29:72
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:227)
    ... 21 more Nov 06, 2012 10:46:46 PM
org.apache.catalina.core.StandardContext startInternal SEVERE: Error
filterStart Nov 06, 2012 10:46:46 PM
org.apache.catalina.core.StandardContext startInternal SEVERE: Context
[/StrutsCRUD] startup failed due to previous errors Nov 06, 2012
10:46:46 PM org.apache.coyote.AbstractProtocol start INFO: Starting
ProtocolHandler ["http-bio-8786"] Nov 06, 2012 10:46:46 PM
org.apache.coyote.AbstractProtocol start INFO: Starting
ProtocolHandler ["ajp-bio-8009"] Nov 06, 2012 10:46:46 PM
org.apache.catalina.startup.Catalina start INFO: Server startup in
3977 ms
4

3 回答 3

5

您已将 Struts 2 jar 放在 Tomcat 库目录中:

Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with 
the name xwork has already been loaded by bean - 
jar:file:/C:/apache-tomcat-7.0.25-windows-x86/apache-tomcat-7.0.25/lib/struts2-core-2.3.4.1.jar!/struts-default.xml:29:72

从 servlet 容器中移除 Struts 相关的库;使用您的应用程序部署它们。

于 2012-11-07T02:23:36.747 回答
0

第 29 行有关 struts-default.xml 的错误意味着您没有所有需要的 struts2 库。

于 2012-11-06T21:30:01.853 回答
0

检查你的库。确保你没有一个以上的 struts2-core-2.3.1.2.jar 库。比如 struts2-core-2.3.1.2.jar(1) 或类似的。

于 2014-05-21T05:22:15.000 回答