收藏 求教高手:Unable to load configuration. - bean - jar:file:

时间:2021-11-18 19:09:16
[11:41:25.895] {main} Caused by: Unable to load configuration. - bean - jar:file:/E:/Workspace2/MSAdapter/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72
[11:41:25.895] {main}  at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)
[11:41:25.895] {main}  at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
[11:41:25.895] {main}  at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
[11:41:25.895] {main}  at com.caucho.server.dispatch.FilterManager.createFilter(FilterManager.java:197)
[11:41:25.895] {main}  ... 18 more
[11:41:25.895] {main} Caused by: Unable to load configuration. - bean - jar:file:/E:/Workspace2/MSAdapter/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72
[11:41:25.895] {main}  at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
[11:41:25.895] {main}  at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
[11:41:25.895] {main}  at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
[11:41:25.895] {main}  ... 21 more
[11:41:25.895] {main} Caused by: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar:file:/E:/Workspace2/MSAdapter/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72
[11:41:25.895] {main}  at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:221)
[11:41:25.895] {main}  at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
[11:41:25.895] {main}  at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:169)
[11:41:25.895] {main}  at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
[11:41:25.895] {main}  ... 23 more
[11:41:25.895] {main} Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:/E:/Workspace2/MSBP_Refactor/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72 - bean - jar:file:/E:/Workspace2/MSAdapter/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72
[11:41:25.895] {main}  at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:205)
[11:41:25.895] {main}  ... 26 more


怎么回事儿啊?

6 个解决方案

#1


大虾帮帮忙啊,在线等啊!!!

#2


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

明显是告诉你重复加载了

#3


jar包冲突了,看下jar包是否有重复的

#4


引用 2 楼 zbxpnet 的回复:
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:/E:/Workspace2/MSBP_Refactor/WebRoot/WEB-INF/lib/struts2-co……



试了,把两个工程的包remove了下,MSBP_Refactor移除报错,MSBP_Refactor移除还是原来这个错误

#5


引用 3 楼 fangmingshijie 的回复:
jar包冲突了,看下jar包是否有重复的


移除还是不行

#6


应该是包冲突了。你可以这样,留struts2运行需要的最少的包试试看看吧。

#1


大虾帮帮忙啊,在线等啊!!!

#2


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

明显是告诉你重复加载了

#3


jar包冲突了,看下jar包是否有重复的

#4


引用 2 楼 zbxpnet 的回复:
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:/E:/Workspace2/MSBP_Refactor/WebRoot/WEB-INF/lib/struts2-co……



试了,把两个工程的包remove了下,MSBP_Refactor移除报错,MSBP_Refactor移除还是原来这个错误

#5


引用 3 楼 fangmingshijie 的回复:
jar包冲突了,看下jar包是否有重复的


移除还是不行

#6


应该是包冲突了。你可以这样,留struts2运行需要的最少的包试试看看吧。