问题描述
struts2-struts1-plugin官方文档http://struts.apache.org/release/2.3.x/docs/struts-1-plugin.html在struts2环境下配置最简单的struts1 actionIn the most simple case, where you have a Struts 1 Action that you want to use in Struts 2, configure a Struts 2 action using the wrapper:<action name="myAction" class="org.apache.struts2.s1.Struts1Action"> <param name="className">com.mycompany.myapp.MyAction</param> <result>myAction.jsp</result></action>访问的时候报错:严重: Exception occurred during processing request: nulljava.lang.InstantiationExceptionat sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)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) 问题补充:完整日志:2013-8-13 9:43:08 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error严重: Exception occurred during processing request: nulljava.lang.InstantiationExceptionat sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)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:131)at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:162)at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151)at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.resolveModel(ScopedModelDrivenInterceptor.java:106)at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:136)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563)at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:178)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)at java.lang.Thread.run(Thread.java:619)
解决方案
看了文档,感觉需要注意的应该有1 To use existing Struts 1 Actions and ActionForms in a Struts 2 application, create a normal Struts 2 configuration package in struts.xml, but have it extend struts1-default. The struts1-default package contains several interceptors and a default interceptor stack that work the plugin into the Struts 2 request process.这里说需要继承struts1-default2 This plugin can be installed by copying the plugin jar into your application's /WEB-INF/lib directory. It will need the Struts 1 jar in order to function correctl相关的 插件jar和strus1相关的jar拷贝到/WEB-INF/lib目录下面
解决方案二:
可以参考下我的博文。http://angelbill3.iteye.com/blog/1892411
解决方案三:
异常只有这么一点么?
解决方案四:
是不是表单数据有问题.processing request: null