`

Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean

阅读更多

今天,tomcat服务器启动时,报严重错误:

2011-4-17 21:41:28 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/E:/apache-tomcat-6.0.24/apache-tomcat-6.0.24/webapps/shundewater/WEB-INF/lib/struts2-core-2.0.6.jar!/struts-default.xml:8:69
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208)
 at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
 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:205)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
 at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
 at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
 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:593)
 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:289)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:/E:/apache-tomcat-6.0.24/apache-tomcat-6.0.24/webapps/shundewater/WEB-INF/lib/struts2-core-2.0.14.jar!/struts-default.xml:30:72 - bean - jar:file:/E:/apache-tomcat-6.0.24/apache-tomcat-6.0.24/webapps/shundewater/WEB-INF/lib/struts2-core-2.0.6.jar!/struts-default.xml:8:69
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:193)
 ... 33 more
2011-4-17 21:41:28 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2011-4-17 21:41:28 org.apache.catalina.core.StandardContext start
严重: Context [/shundewater] startup failed due to previous errors

 

解决办法:去web-inf下的lib下看是否存在相同的jar包,我的就是有相同的jar包,但是版本号不一样。找到了两个相同的jar包后,就删掉一个jar包,重新启动tomcat。

分享到:
评论

相关推荐

    com.opensymphony.xwork2.DefaultActionProxy

    com.opensymphony.xwork2.DefaultActionProxy com.opensymphony.xwork2.DefaultActionInvocation org.apache.struts2.dispatcher.FilterDispatcher

    xwork-core-2.3.37.jar

    用于解决struts2升级至2.3.37时 出现java.lang.NoSuchMethodError: com.opensymphony.xwork2.ActionContext.put(Ljava/lang/异常时,更换的xwork-core-2.3.37.jar

    xwork-2.1.5-all.rar_xwork_xwork-2.1.5_xwork-2.1.5.jar_xwork-core

    XWork与Struts2紧密相关,Struts2是基于XWork构建的一个MVC框架,它在XWork的基础上增加了视图层的支持,提供了更全面的Web应用解决方案。 8. **应用场景**: XWork常用于企业级的Web应用开发,尤其适合那些需要...

    struts-2.1.6.chm

    com.opensymphony.xwork2 ...com.opensymphony.xwork2.spring Spring ObjectFactory classes. com.opensymphony.xwork2.spring.interceptor Spring specific interceptor classes. com.opensymphony.xwork2.test ...

    OpenSymphony公司的xwork资源包

    在XWork中,每个动作都是一个Java类,该类通常继承自`com.opensymphony.xwork2.ActionSupport`基类。开发者可以在这个类中定义处理用户请求的方法,并在XML配置文件中指定这些方法与URL请求的对应关系。这样,当用户...

    升级struts2.3.32 需要的jar:asm-3.3.jar,asm-commons-3.3,asm-tree-3.3.jar

    不然有以下报错java.lang.NoClassDefFoundError: com/opensymphony/xwork2/util/finder/ClassFinder$InfoBuildingVisitor,导入asm-3.3.jar,asm-commons-3.3,asm-tree-3.3.jar即可,压缩包里面有

    struts2-core-2.1.8.1 xwork-core-2.1.6源码

    3. **类型转换(Type Conversion)**:Struts2自动处理用户输入数据的类型转换,这在`com.opensymphony.xwork2.converters`包中实现。例如,`StringConverter`将字符串转换为其他类型,如整数或日期。 4. **配置...

    struts 2.3.4.1 最新英文版API

    struts 2.3.4.1 最新英文版...com.opensymphony.xwork2.spring Spring ObjectFactory classes. com.opensymphony.xwork2.spring.interceptor Spring specific interceptor classes. com.opensymphony.xwork2.test ...

    struts2下的Xwork2源文件

    struts2下的Xwork2源文件 在 opensymphony开源社区http://www.opensymphony.com/ 可匿名使用SVN checkout xwork2的源代码 http://svn.opensymphony.com/svn/xwork/trunk

    struts-2.1.8.1-src.zip

    Apache Struts ... This product includes software developed by ...XWork (http://www.opensymphony.com/xwork/). XPP3 (http://www.extreme.indiana.edu/xgws/xsoap/xpp/). XStream (http://xstream.codehaus.org/).

    xwork-2.0.5-src

    2. **类型转换(Type Conversion)**:`com.opensymphony.xwork2.converters`包提供了类型转换的支持。XWork通过`Converter`接口实现各种数据类型的自动转换,如字符串到日期、数字等,极大地简化了开发者的工作。 ...

    struts2-core-2.3.15.3.jar

    Apache Struts ... This product includes software developed by ...XWork (http://www.opensymphony.com/xwork/). XPP3 (http://www.extreme.indiana.edu/xgws/xsoap/xpp/). XStream (http://xstream.codehaus.org/).

    struts-2.3.15.3-apps.zip

    Apache Struts ... This product includes software developed by ...XWork (http://www.opensymphony.com/xwork/). XPP3 (http://www.extreme.indiana.edu/xgws/xsoap/xpp/). XStream (http://xstream.codehaus.org/).

    Struts2配置详解

    &lt;bean type="com.opensymphony.xwork2.ObjectFactory" name="struts" class="org.apache.struts2.impl.StrutsObjectFactory"/&gt; &lt;bean type=...

    xwork-2.1.6.rar

    `com.opensymphony.xwork2.config.ConfigurationManager`和`com.opensymphony.xwork2.config.Configuration`类负责加载和解析配置。 7. **异常处理** XWork提供了优雅的异常处理机制,当Action执行过程中出现错误...

    xwork-core-2.3.8

    取代xwork-2.x.x,解决java.lang.ClassNotFoundException: com.opensymphony.xwork2.config.FileManager问题

    struts2 依赖核心包 --xwork 源文件

    XWork是Struts2的核心组件,它负责处理Action的业务逻辑和控制流程。在深入理解Struts2与XWork的关系之前,我们首先需要了解这两个概念的基础知识。 Struts2框架是在原有的Struts1的基础上进行改进和升级的,它克服...

    xwork-2.0.4-src

    2. **com.opensymphony.xwork2.util**:这个包包含了一系列的工具类,如反射工具、表达式语言支持等,它们在框架内部广泛使用,提供了便利的功能。 3. **com.opensymphony.xwork2.config**:配置管理模块,负责加载...

    xwork-2.0.4源码

    在xwork-2.0.4中,`com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler`和`com.opensymphony.xwork2.util.reflection.ReflectionProvider`类共同协作,实现了对象的实例化和属性设置,使得Action的...

    stuts2.2_API文档

    com.opensymphony.xwork2.XWorkException (implements com.opensymphony.xwork2.util.location.Locatable) org.apache.struts2.StrutsException (implements com.opensymphony.xwork2.util.location.Locatable)

Global site tag (gtag.js) - Google Analytics