Unable to find a result type for extension [...] in location attribute

Source: Internet
Author: User

There are probably many reasons. I only say what I encountered.

The project uses spring + struts2 + JPA, Maven management, JSP in Java/main/webapp/WEB-INF/content.

Generally, Action sets a directory, but there are several JSP files under the root directory, such as login. JSP, Main. JSP, nopermisson. JSP, corresponding to the action with namespace set.

Nopermission. Action.

I have a common action file: crudaction, which implements some basic actions. Most other actions inherit from it.

In this crudaction, a result named nopermission is defined to point to nopermission. Action under the root directory. The initial statement is as follows:

@Results({@Result(name = "nopermission", location = "/nopermission.action") })public abstract class CrudAction<T, TService extends ICrudService<T>> extendsCrudActionSupport<T> {public static final String NOPERMISSION = "nopermission";……} 

Run Tomcat and start to report the following error:

16:48:18, 483 [main] error [Org. apache. struts2.dispatcher. dispatcher]-DISPATCHER initialization failedunable to load configuration. -[unknown location] at com. opensymphony. xwork2.config. configurationmanager. getconfiguration (configurationmanager. java: 69) at Org. apache. struts2.dispatcher. dispatcher. init_preloadconfiguration (dispatcher. java: 390) at Org. apache. struts2.dispatcher. dispatcher. init (dispatcher. java: 436) at Org. apache. struts2.dispatcher. ng. initoperations. initdispatcher (initoperations. java: 69) at Org. apache. struts2.dispatcher. ng. filter. strutsprepareandexecutefilter. init (strutsprepareandexecutefilter. java: 51) 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: 4001) at Org. apache. catalina. core. standardcontext. start (standardcontext. java: 4651) at Org. apache. catalina. core. containerbase. start (containerbase. java: 1045) at Org. apache. catalina. core. standardhost. start (standardhost. java: 785) at Org. apache. catalina. core. containerbase. start (containerbase. java: 1045) at Org. apache. catalina. core. standardengine. start (standardengine. java: 445) at Org. apache. catalina. startup. embedded. start (embedded. java: 825) at Org. codehaus. mojo. tomcat. abstractrunmojo. startcontainer (maid. java: 558) at org.codehaus.mojo.tomcat.abstractrunmojo.exe cute (abstractrunmojo. java: 255) at org.apache.maven.plugin.defabuilbuildpluginmanager.exe cutemojo (defabuilbuildpluginmanager. java: 101) at org.apache.maven.lifecycle.internal.mojoexecutor.exe cute (mojoexecutor. java: 209) at org.apache.maven.lifecycle.internal.mojoexecutor.exe cute (mojoexecutor. java: 153) at org.apache.maven.lifecycle.internal.mojoexecutor.exe cute (mojoexecutor. java: 145) at Org. apache. maven. lifecycle. internal. lifecyclemodulebuilder. buildproject (lifecyclemodulebuilder. java: 84) at Org. apache. maven. lifecycle. internal. lifecyclemodulebuilder. buildproject (lifecyclemodulebuilder. java: 59) at Org. apache. maven. lifecycle. internal. lifecyclestarter. singlethreadedbuild (lifecyclestarter. java: 183) at org.apache.maven.lifecycle.internal.lifecyclestarter.exe cute (lifecyclestarter. java: 161) at Org. apache. maven. defaultmaven. doexecute (defaultmaven. java: 320) at org.apache.maven.defaultmaven.exe cute (defaultmaven. java: 156) at org.apache.maven.cli.mavencli.exe cute (mavencli. java: 537) at Org. apache. maven. CLI. mavencli. domain (mavencli. java: 196) at Org. apache. maven. CLI. mavencli. main (mavencli. java: 141) at Sun. reflect. nativemethodaccessorimpl. invoke0 (native method) at Sun. reflect. nativemethodaccessorimpl. invoke (nativemethodaccessorimpl. java: 57) at Sun. reflect. delegatingmethodaccessorimpl. invoke (delegatingmethodaccessorimpl. java: 43) at java. lang. reflect. method. invoke (method. java: 601) at Org. codehaus. plexus. classworlds. launcher. launcher. launchenhanced (launcher. java: 290) at Org. codehaus. plexus. classworlds. launcher. launcher. launch (launcher. java: 230) at Org. codehaus. plexus. classworlds. launcher. launcher. mainwithexitcode (launcher. java: 409) at Org. codehaus. plexus. classworlds. launcher. launcher. main (launcher. java: 352) caused by: unable to find a result type for extension [action] in location attribute [/nopermission. action]. -[unknown location] At Org. apache. struts2.convention. defaultresultmapbuilder $ resultinfo. determinetype (defaultresultmapbuilder. java: 513) at Org. apache. struts2.convention. defaultresultmapbuilder $ resultinfo. <init> (defaultresultmapbuilder. java: 485) at Org. apache. struts2.convention. defaultresultmapbuilder. createfromannotations (defaultresultmapbuilder. java: 410) at Org. apache. struts2.convention. defaultresultmapbuilder. createresultsfromannotations (defaultresultmapbuilder. java: 220) at Org. apache. struts2.convention. defaultresultmapbuilder. build (defaultresultmapbuilder. java: 196) at Org. apache. struts2.convention. packagebasedactionconfigbuilder. createactionconfig (packagebasedactionconfigbuilder. java: 864) at Org. apache. struts2.convention. packagebasedactionconfigbuilder. buildconfiguration (packagebasedactionconfigbuilder. java: 636) at Org. apache. struts2.convention. packagebasedactionconfigbuilder. buildactionconfigs (packagebasedactionconfigbuilder. java: 335) at Org. apache. struts2.convention. classpathpackageprovider. loadpackages (classpathpackageprovider. java: 53) at com. opensymphony. xwork2.config. impl. defaultconfiguration. reloadcontainer (defaultconfiguration. java: 215) at com. opensymphony. xwork2.config. configurationmanager. getconfiguration (configurationmanager. java: 66 )... 37 more May 11 4:48:18 Org. apache. catalina. core. standardcontext filterstart is serious: exception starting filter struts2filterunable to load configuration. -[unknown location] At Org. apache. struts2.dispatcher. dispatcher. init (dispatcher. java: 449) at Org. apache. struts2.dispatcher. ng. initoperations. initdispatcher (initoperations. java: 69) at Org. apache. struts2.dispatcher. ng. filter. strutsprepareandexecutefilter. init (strutsprepareandexecutefilter. java: 51) 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: 4001) at Org. apache. catalina. core. standardcontext. start (standardcontext. java: 4651) at Org. apache. catalina. core. containerbase. start (containerbase. java: 1045) at Org. apache. catalina. core. standardhost. start (standardhost. java: 785) at Org. apache. catalina. core. containerbase. start (containerbase. java: 1045) at Org. apache. catalina. core. standardengine. start (standardengine. java: 445) at Org. apache. catalina. startup. embedded. start (embedded. java: 825) at Org. codehaus. mojo. tomcat. abstractrunmojo. startcontainer (maid. java: 558) at org.codehaus.mojo.tomcat.abstractrunmojo.exe cute (abstractrunmojo. java: 255) at org.apache.maven.plugin.defabuilbuildpluginmanager.exe cutemojo (defabuilbuildpluginmanager. java: 101) at org.apache.maven.lifecycle.internal.mojoexecutor.exe cute (mojoexecutor. java: 209) at org.apache.maven.lifecycle.internal.mojoexecutor.exe cute (mojoexecutor. java: 153) at org.apache.maven.lifecycle.internal.mojoexecutor.exe cute (mojoexecutor. java: 145) at Org. apache. maven. lifecycle. internal. lifecyclemodulebuilder. buildproject (lifecyclemodulebuilder. java: 84) at Org. apache. maven. lifecycle. internal. lifecyclemodulebuilder. buildproject (lifecyclemodulebuilder. java: 59) at Org. apache. maven. lifecycle. internal. lifecyclestarter. singlethreadedbuild (lifecyclestarter. java: 183) at org.apache.maven.lifecycle.internal.lifecyclestarter.exe cute (lifecyclestarter. java: 161) at Org. apache. maven. defaultmaven. doexecute (defaultmaven. java: 320) at org.apache.maven.defaultmaven.exe cute (defaultmaven. java: 156) at org.apache.maven.cli.mavencli.exe cute (mavencli. java: 537) at Org. apache. maven. CLI. mavencli. domain (mavencli. java: 196) at Org. apache. maven. CLI. mavencli. main (mavencli. java: 141) at Sun. reflect. nativemethodaccessorimpl. invoke0 (native method) at Sun. reflect. nativemethodaccessorimpl. invoke (nativemethodaccessorimpl. java: 57) at Sun. reflect. delegatingmethodaccessorimpl. invoke (delegatingmethodaccessorimpl. java: 43) at java. lang. reflect. method. invoke (method. java: 601) at Org. codehaus. plexus. classworlds. launcher. launcher. launchenhanced (launcher. java: 290) at Org. codehaus. plexus. classworlds. launcher. launcher. launch (launcher. java: 230) at Org. codehaus. plexus. classworlds. launcher. launcher. mainwithexitcode (launcher. java: 409) at Org. codehaus. plexus. classworlds. launcher. launcher. main (launcher. java: 352) caused by: Unable to load configuration. -[unknown location] at com. opensymphony. xwork2.config. configurationmanager. getconfiguration (configurationmanager. java: 69) at Org. apache. struts2.dispatcher. dispatcher. init_preloadconfiguration (dispatcher. java: 390) at Org. apache. struts2.dispatcher. dispatcher. init (dispatcher. java: 436 )... 35 morecaused by: unable to find a result type for extension [action] in location attribute [/nopermission. action]. -[unknown location] At Org. apache. struts2.convention. defaultresultmapbuilder $ resultinfo. determinetype (defaultresultmapbuilder. java: 513) at Org. apache. struts2.convention. defaultresultmapbuilder $ resultinfo. <init> (defaultresultmapbuilder. java: 485) at Org. apache. struts2.convention. defaultresultmapbuilder. createfromannotations (defaultresultmapbuilder. java: 410) at Org. apache. struts2.convention. defaultresultmapbuilder. createresultsfromannotations (defaultresultmapbuilder. java: 220) at Org. apache. struts2.convention. defaultresultmapbuilder. build (defaultresultmapbuilder. java: 196) at Org. apache. struts2.convention. packagebasedactionconfigbuilder. createactionconfig (packagebasedactionconfigbuilder. java: 864) at Org. apache. struts2.convention. packagebasedactionconfigbuilder. buildconfiguration (packagebasedactionconfigbuilder. java: 636) at Org. apache. struts2.convention. packagebasedactionconfigbuilder. buildactionconfigs (packagebasedactionconfigbuilder. java: 335) at Org. apache. struts2.convention. classpathpackageprovider. loadpackages (classpathpackageprovider. java: 53) at com. opensymphony. xwork2.config. impl. defaultconfiguration. reloadcontainer (defaultconfiguration. java: 215) at com. opensymphony. xwork2.config. configurationmanager. getconfiguration (configurationmanager. java: 66 )... 37 more

Then, I changed it to the following:

@Results({@Result(name = "nopermission", location = "/nopermission.action", type = "redirect") })public abstract class CrudAction<T, TService extends ICrudService<T>> extendsCrudActionSupport<T> {public static final String NOPERMISSION = "nopermission";……}

The default result type of action is dispatcher. The location of this method can only be page, not another action.

The following two URLs provide a brief explanation of the problem:

Http://hi.baidu.com/foreverfly8/item/4bfae9cc04abb80c0bd93a79

Http://blog.sina.com.cn/s/blog_56b7aaa10100eqs4.html

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.