struts2异常

由于使用WTP插件,tomcat部署跟myEclipse不太一样,使struts2碰到个问题:

 

ERROR [Dispatcher] Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:.../WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72

 

Caused by: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:.../WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72

 

Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:/D:/apache-tomcat-6.0.20/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72 - bean - jar:file:.../WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72

 

看错误第三条,很明显是重复加载了struts2-core.jar文件,这里粗心大意了,之前某项目的jar包配置到了tomcat的lib下面,所以新部署的项目先加载tomcat的lib,然后加载项目/WEB-INF/lib目录,造成重复加载。

你可能感兴趣的:(tomcat,bean,Web,MyEclipse,struts)