Struts2 SEOActionNameBuild (The action name cannot be the same as the action suffix [Action]) 终极解决方案
2016-08-01 15:24
441 查看
在SSH整合项目时候出现以下问题
原来问题出在这个文件的配置,该文件明确表明了会检索以action,actions,struts,struts2的名字检索对应的jar包,那么org.apache.struts.Action自然而然会被解析。
发生异常也是理所当然的,那么我们打开自己的struts.xml文件修改常量,因为项目的struts.xml的配置是高于
插件配置的,更改如下:
表示插件只对actions和struts2包感兴趣,于是乎异常被解决了。
当然如果表示对使用(struts-convention-plugin.jar)压力很大的童鞋们,可以考虑直接删除该jar包不使用,异常一样可以解决。
发生这个异常也不要想当然的认为将所有Action类得名字中去除Action关键字就能解决。
Line: 64 - org/apache/struts2/convention/SEOActionNameBuilder.java:64:-1 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431) 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:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4356) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.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:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.IllegalStateException: The action name cannot be the same as the action suffix [Action] at org.apache.struts2.convention.SEOActionNameBuilder.build(SEOActionNameBuilder.java:64) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.determineActionName(PackageBasedActionConfigBuilder.java:712) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfiguration(PackageBasedActionConfigBuilder.java:535) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:318) at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418) ... 29 more 2011-8-9 10:22:11 org.apache.catalina.core.StandardContext start 严重: Error filterStart 2011-8-9 10:22:11 org.apache.catalina.core.StandardContext start |
发生异常也是理所当然的,那么我们打开自己的struts.xml文件修改常量,因为项目的struts.xml的配置是高于
插件配置的,更改如下:
<constant name="struts.convention.package.locators" value="actions,struts2"/> |
当然如果表示对使用(struts-convention-plugin.jar)压力很大的童鞋们,可以考虑直接删除该jar包不使用,异常一样可以解决。
发生这个异常也不要想当然的认为将所有Action类得名字中去除Action关键字就能解决。
相关文章推荐
- Struts2 SEOActionNameBuild (The action name cannot be the same as the action suffix [Action]) 终极解决方案
- The action name cannot be the same as the action suffix [Action]遇到此有关问题的解决办法
- Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP
- Synthesized property 'xx' must either be named the same as a compatible ivar or must explicitly name
- [未解决] The username entered must be the same as the database accesss account for the server farm you wish to join.
- The project cannot be built until build path errors are resolved 解决方案
- AddFieldAsXml cannot be used to set the InternalName correctly
- struts2的“The file cannot be validated as the host "struts.apache.org" is currently unreachable"问题解决
- The project cannot be built until build path errors are resolved解决方案
- Deprecated: Methods with the same name as their class will not be constructors in a future version o
- [PHP] Deprecated: Methods with the same name as their class will not be constructor...
- android环境配置之后,编译时提示:The project cannot be built until build path errors are resolved 的解决方案
- as 导入eclipse项目报错:Error:Application and test application id cannot be the same: both are 'com.hjy.act
- qt: The build directory needs to be at the same level as the source directory.
- Deprecated: Methods with the same name as their class will not be constructors in a future version
- 从AS导入Eclipse项目,报Error:Application and test application id cannot be the same: both are 'com.
- Dapper:The member of type SeoTKD cannot be used as a parameter Value
- Error: member names cannot be the same as their enclosing type
- The project cannot be built until build path errors are resolved的解决方法
- The project cannot be built until build path errors are resolved