Struts1 与 Struts2 集成

杨_静 发布于 2012/11/23 19:46
阅读 1K+
收藏 0
两个系统集成,一个是struts1构建,一个是struts2 使用

struts2-struts1-plugin-2.3.4.1.jar插件,启动tomcat时,报错。

其中我已经添加了struts1.jar 和struts2-struts1-plugin-2.3.4.1.jar到maven 库中

求大神指导了

 
 
2012-11-23 19:38:40,704 WARN  [InterceptorBuilder] Unable to load config class org.apache.struts2.s1.ActionFormValidationInterceptor at interceptor - jar:file:/D:/openxds/openxds-web/target/openxds-web/WEB-INF/lib/struts2-struts1-plugin-2.3.4.1.jar!/struts-plugin.xml:33:118 probably due to a missing jar, which might be fine if you never plan to use the actionForm-validation interceptor
2012-11-23 19:38:40,705 ERROR [InterceptorBuilder] Actual exception
Could not load class org.apache.struts2.s1.ActionFormValidationInterceptor. Perhaps it exists but certain dependencies are not available? - interceptor - jar:file:/D:/openxds/openxds-web/target/openxds-web/WEB-INF/lib/struts2-struts1-plugin-2.3.4.1.jar!/struts-plugin.xml:33:118
	at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:82)
	at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:57)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:864)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:699)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:712)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:733)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:365)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
	at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
	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:201)
	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:4072)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	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: java.lang.NoClassDefFoundError: com/opensymphony/xwork2/util/logging/LoggerFactory
	at org.apache.struts2.s1.ActionFormValidationInterceptor.<clinit>(ActionFormValidationInterceptor.java:67)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at java.lang.Class.newInstance0(Class.java:355)
	at java.lang.Class.newInstance(Class.java:308)
	at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:121)
	at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:152)
	at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:141)
	at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:53)
	... 31 more
Caused by: java.lang.ClassNotFoundException: com.opensymphony.xwork2.util.logging.LoggerFactory
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
	... 42 more
加载中
0
缪斯的情人
缪斯的情人
好蛋疼的需求,后期怎么维护这样乱的代码呢?
0
whaon
whaon
为什么是s1和s2集成
杨_静
杨_静
因为第一个项目是很久以前的呗,
0
JFinal
JFinal
苦海无边,回头是岸
杨_静
杨_静
阿弥陀佛~~~
0
Ryan-瑞恩
Ryan-瑞恩
为什么你要集成s1,和s2.....我很好奇你为什么这么做???
0
lateron
lateron
这就是传说中的搞基
0
jobell
jobell

两个项目单独 运行。只要做单点登录不就可以了吗??

没有这么整合项目的呀。

E
Ellipse
同意
0
大喵哥
大喵哥
这个完全是奇葩?你们项目经理让你这么干的?真2~!
杨_静
杨_静
额,也可能是我不太懂,两个功能都是socket 通信,但是,一个是struts1 一个是struts2啊
0
南湖船老大
南湖船老大

奇葩啊,跟一句,哈哈,从业这么多年第一次见这么奇葩的处理方式。

都是socket通讯,手写原始Java代码不行么?

phprpc这种中间件不行么?


0
南湖船老大
南湖船老大

另,报错是jar包冲突,导致classloader出错。

放弃吧,施主,别挣扎了,方向错了,挣扎也是徒劳。考虑下我上面提的方案

杨_静
杨_静
药西,struts是有这个处理机制的,只是没看透彻而已,不知道都加载哪个包。
0
a
a782313536

我也遇到这个问题。怎么解决的。。求解。

Navee7
Navee7
问题在49行Caused by: java.lang.ClassNotFoundException 应该是缺少log相关jar包
返回顶部
顶部