500 errors reported after the first consolidated struts2+spring submission form

Source: Internet
Author: User
Tags prepare

SPRING+STRUTS2 integration, do a user login test program, with the configuration file fragment
<constant name= "struts.objectfactory" value= "Spring"/>

<package name= "Struts-config" namespace= "/" extends= "Struts-default" >

<action name= "Login" class= "Loginaction" >
<result name= "Frame" >/frame.jsp </result>
</action>
</package>
</struts>
However, the following 500 errors are reported after submitting the form, if the direct write class= "com.system.actionLoginAction" can be executed

Unable to instantiate Action, loginaction, defined for ' login ' namespace '/' Loginaction
Com.opensymphony.xwork2.DefaultActionInvocation.createAction (defaultactioninvocation.java:306)
Com.opensymphony.xwork2.DefaultActionInvocation.init (defaultactioninvocation.java:387)
Com.opensymphony.xwork2.DefaultActionProxy.prepare (defaultactionproxy.java:186)
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:47)
Org.apache.struts2.dispatcher.Dispatcher.serviceAction (dispatcher.java:458)
Org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction (executeoperations.java:77)
Org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter ( strutsprepareandexecutefilter.java:76)

From the wrong view, Spring failed to create an action for struts2, which could be the cause:

1. Struts2-spring-plugin-2.1.8.1.jar not loaded

2. Package conflict, delete Asm.jar (online speaking)

3.struts or spring config file error (see my "struts2+spring Integration Framework")

4.spring configuration file name error, Spring profile default is Applicationcontext.xml, in Web. XML may be paired with

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/web-inf/applicationcontext-*.xml, classpath*:applicationcontext-*.xml< /param-value>
</context-param>


This article is from the "No Water Fish" blog, please be sure to keep this source http://javaqun.blog.51cto.com/10687700/1704867

500 errors reported after the first consolidated struts2+spring submission form

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.