Struts 2.x unable to load configuration.-Action

Source: Internet
Author: User

Problem Analysis: this problem is generally caused by the incorrect configuration of a configuration file in struts, for example:

1. testaction in class is not loaded successfully:

    <constant name="struts.i18n.reload" value="true" />     <!-- <include file="struts/struts-test.xml"/> -->     <package name="system" extends="struts-default">        <action name="totalfilter" class="TestAction">              <result name="success" >success.jsp</result>                   </action>      </package>
2. mistakenly write name as type, for example:
<! -- Correct syntax --> <result name = "error">/error. jsp </result> <! -- Incorrect syntax --> <result type = "error">/error. jsp </result>

 

Error code:

Severe: exception starting filter struts2unable to load configuration. -Action-file:/E:/workspaces/myeclipse 2014/struts2/Apache-Tomcat-7.0.5/webapps/struts2_2000_strutstags/WEB-INF/classes/struts. XML: 14: 71 at com. opensymphony. xwork2.config. configurationmanager. getconfiguration (configurationmanager. java: 58) at Org. apache. struts2.dispatcher. dispatcher. init_preloadconfiguration (dispatcher. java: 360) Org. apache. struts2.dispatcher. dispatcher. init (dispatcher. java: 403) at Org. apache. struts2.dispatcher. ng. initoperations. initdispatcher (initoperations. java: 69) at Org. apache. struts2.dispatcher. ng. filter. strutsprepareandexecutefilter. init (strutsprepareandexecutefilter. java: 48) at Org. apache. catalina. core. applicationfilterconfig. initfilter (applicationfilterconfig. java: 273) at Org. apache. catalina. core. Applicationfilterconfig. getfilter (applicationfilterconfig. java: 254) at Org. apache. catalina. core. applicationfilterconfig. setfilterdef (applicationfilterconfig. java: 372) at Org. apache. catalina. core. applicationfilterconfig. <init> (applicationfilterconfig. java: 98) at Org. apache. catalina. core. standardcontext. filterstart (standardcontext. java: 4405) at Org. apache. catalina. core. standardcontext. startinternal (Standardcontext. java: 5037) at Org. apache. catalina. util. lifecyclebase. start (lifecyclebase. java: 140) at Org. apache. catalina. core. containerbase. addchildinternal (containerbase. java: 812) at Org. apache. catalina. core. containerbase. addchild (containerbase. java: 787) at Org. apache. catalina. core. standardhost. addchild (standardhost. java: 570) at Org. apache. catalina. startup. hostconfig. deploydirectory (hostconfig. J Java: 1010) at Org. apache. catalina. startup. hostconfig. deploydirectories (hostconfig. java: 933) at Org. apache. catalina. startup. hostconfig. deployapps (hostconfig. java: 468) at Org. apache. catalina. startup. hostconfig. start (hostconfig. java: 1267) at Org. apache. catalina. startup. hostconfig. lifecycleevent (hostconfig. java: 308) at Org. apache. catalina. util. lifecyclesupport. firelifecycleevent (lifecyclesupport. java: 1 19) at Org. apache. catalina. util. lifecyclebase. firelifecycleevent (lifecyclebase. java: 89) at Org. apache. catalina. util. lifecyclebase. setstate (lifecyclebase. java: 328) at Org. apache. catalina. util. lifecyclebase. setstate (lifecyclebase. java: 308) at Org. apache. catalina. core. containerbase. startinternal (containerbase. java: 1043) at Org. apache. catalina. core. standardhost. startinternal (standardhost. java: 738) Org. apache. catalina. util. lifecyclebase. start (lifecyclebase. java: 140) at Org. apache. catalina. core. containerbase. startinternal (containerbase. java: 1035) at Org. apache. catalina. core. standardengine. startinternal (standardengine. java: 289) at Org. apache. catalina. util. lifecyclebase. start (lifecyclebase. java: 140) at Org. apache. catalina. core. standardservice. startinternal (standardservice. java: 442) at Org. apach E. catalina. util. lifecyclebase. start (lifecyclebase. java: 140) at Org. apache. catalina. core. standardserver. startinternal (standardserver. java: 674) at Org. apache. catalina. util. lifecyclebase. start (lifecyclebase. java: 140) at Org. apache. catalina. startup. catalina. start (Catalina. java: 596) at Sun. reflect. nativemethodaccessorimpl. invoke0 (native method) at Sun. reflect. nativemethodaccessorimpl. invoke (nativemetho Daccessorimpl. 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: 303) at Org. apache. catalina. startup. bootstrap. main (Bootstrap. java: 431) caused by: Error building results for Action tags in namespace-action-file:/E:/workspaces/myeclipse9 /Struts2/Apache-Tomcat-7.0.5/webapps/struts2_2000_strutstags/WEB-INF/classes/struts. XML: 14: 71 at com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. addaction (xmlconfigurationprovider. java: 366) at com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. addpackage (xmlconfigurationprovider. java: 460) at com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. loadpack Ages (xmlconfigurationprovider. java: 265) at Org. apache. struts2.config. strutsxmlconfigurationprovider. loadpackages (strutsxmlconfigurationprovider. java: 111) at com. opensymphony. xwork2.config. impl. defaultconfiguration. reloadcontainer (defaultconfiguration. java: 189) at com. opensymphony. xwork2.config. configurationmanager. getconfiguration (configurationmanager. java: 55 )... 40 morecaused by: There is no res Ult type defined for Type 'tag' mapped with name 'success '. Did you mean 'tag '? -Result-file:/E:/workspaces/myeclipse9/struts2/Apache-Tomcat-7.0.5/webapps/struts2_2000_strutstags/WEB-INF/classes/struts. XML: 15: 32 at com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. buildresults (xmlconfigurationprovider. java: 613) at com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. addaction (xmlconfigurationprovider. java: 364 )... 45 more2011-10-24 11:36:09 Org. apache. catalina. core. standardcontext startinternal severe: Error filterstart

 

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.