SSH框架整合,启动tomcat就报错:Unable to load configuration. - bean - 。。。

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Unseenblade/article/details/52864770

我在用myeclipse整合SSH框架后,启动tomcat就报错,SSH版本是;spring2.5.6,Struts2.1.6,hibernate2.1.8。其中有个jar包没有就下了最新的:struts2-spring-plugin-2.5.2jar。

启动tomcat就报错,想着觉得是版本问题,重下了struts2-spring-plugin-2.1.6jar,启动tomcat还是报错:


Unable to load configuration. - bean - jar:file:/E:/Program%20File/apache-tomcat-8.0.36/webapps/springWebProject/WEB-INF/lib/struts2-spring-plugin-2.5.2.jar!/struts-plugin.xml:29:132
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:4689)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5329)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: Unable to load configuration. - bean - jar:file:/E:/Program%20File/apache-tomcat-8.0.36/webapps/springWebProject/WEB-INF/lib/struts2-spring-plugin-2.5.2.jar!/struts-plugin.xml:29:132
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)
... 18 more
Caused by: Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory class:org.apache.struts2.spring.StrutsSpringObjectFactory - bean - jar:file:/E:/Program%20File/apache-tomcat-8.0.36/webapps/springWebProject/WEB-INF/lib/struts2-spring-plugin-2.5.2.jar!/struts-plugin.xml:29:132
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:221)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:169)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
... 20 more
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name spring has already been loaded by bean - jar:file:/E:/Program%20File/apache-tomcat-8.0.36/webapps/springWebProject/WEB-INF/lib/struts2-spring-plugin-2.1.6.jar!/struts-plugin.xml:29:132 - bean - jar:file:/E:/Program%20File/apache-tomcat-8.0.36/webapps/springWebProject/WEB-INF/lib/struts2-spring-plugin-2.5.2.jar!/struts-plugin.xml:29:132
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:205)
... 23 more

网上查资料说可能是包冲突,可是我已经删掉重复包了,后来想到我删掉的是myeclipse下workspace中的jar包,tomcat项目下应该还在,去目录看果然还在,

把tomcat下重复包删掉,重启tomcat,顺利启动了。

展开阅读全文

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