求助spring2.0+struts2+JDBC整合的小问题
StrutsProblemReportStrutshasdetectedanunhandledexception:Messages:userActionUnabletoi...
Struts Problem Report
Struts has detected an unhandled exception:
Messages: userAction
Unable to instantiate Action, userAction, defined for 'login' in namespace '/'userAction
File: org/apache/catalina/loader/WebappClassLoader.java
Line number: 1,680
_____________________________________________________
Stacktraces
Unable to instantiate Action, userAction, defined for 'login' in namespace '/'userAction
下面一堆调用
java.lang.ClassNotFoundException: userAction
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:157)
com.opensymphony.xwork2.ObjectFactory.getClassInstance(ObjectFactory.java:107)
com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:223)
com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:143)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:120)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:299)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:399)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:198)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:475)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
还有很多没有写 ,字数不够了。
我大概说一下吧:情况是这样的:当我把struts的实例控制交给spring之后,
即applicationContext.xml中:<bean id="userAction" class="com.t.actions.UserAction" scope="prototype">
<property name="userv" ref="userv"></property>
</bean>以及struts.xml中<struts>
<constant name="struts.objectFactory" value="spring"></constant>
<package name="default" extends="struts-default">
<action name="login" class="userAction" method="login">
<result name="success" type="redirect">/show.action</result>
<result name="input">/loginput.jsp</result>
</action>
提交数据后,发现上面的问题 并且actions中的login()方法没有执行,当我抛弃sping之后自己通过struts.xml自己实例化之后,发现是可以访问到login()的 说明我的struts2没有问题。并且xml的strutsprepareAndexecuteFilter以及contextLoadLintener都有写,struts-spring-x.x.x.jar也有导入。却实在不知是哪里出了问题,还望各位大侠不吝赐教!不胜赶紧! 展开
Struts has detected an unhandled exception:
Messages: userAction
Unable to instantiate Action, userAction, defined for 'login' in namespace '/'userAction
File: org/apache/catalina/loader/WebappClassLoader.java
Line number: 1,680
_____________________________________________________
Stacktraces
Unable to instantiate Action, userAction, defined for 'login' in namespace '/'userAction
下面一堆调用
java.lang.ClassNotFoundException: userAction
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:157)
com.opensymphony.xwork2.ObjectFactory.getClassInstance(ObjectFactory.java:107)
com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:223)
com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:143)
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)
com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:120)
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:299)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:399)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:198)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:475)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
还有很多没有写 ,字数不够了。
我大概说一下吧:情况是这样的:当我把struts的实例控制交给spring之后,
即applicationContext.xml中:<bean id="userAction" class="com.t.actions.UserAction" scope="prototype">
<property name="userv" ref="userv"></property>
</bean>以及struts.xml中<struts>
<constant name="struts.objectFactory" value="spring"></constant>
<package name="default" extends="struts-default">
<action name="login" class="userAction" method="login">
<result name="success" type="redirect">/show.action</result>
<result name="input">/loginput.jsp</result>
</action>
提交数据后,发现上面的问题 并且actions中的login()方法没有执行,当我抛弃sping之后自己通过struts.xml自己实例化之后,发现是可以访问到login()的 说明我的struts2没有问题。并且xml的strutsprepareAndexecuteFilter以及contextLoadLintener都有写,struts-spring-x.x.x.jar也有导入。却实在不知是哪里出了问题,还望各位大侠不吝赐教!不胜赶紧! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询