struts2 修改配置文件的默认位置报异常的解决方法
2012-11-12 10:46
726 查看
异常:
com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, name='default'] in public void com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.setObjectFactory(com.opensymphony.xwork2.ObjectFactory).
- Class: com.opensymphony.xwork2.inject.ContainerImpl File: ContainerImpl.java
解决方法:
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>struts-default.xml,struts-plugin.xml,struts2/struts-*.xml</param-value>
</init-param>
</filter>
即,必须添加
struts-default.xml(必须),struts-plugin.xml(可选)二个额外的配置文件.
原因:
struts-default.xml是默认配置文件,一些必须的框架参数都默认设置在此.
com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, name='default'] in public void com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.setObjectFactory(com.opensymphony.xwork2.ObjectFactory).
- Class: com.opensymphony.xwork2.inject.ContainerImpl File: ContainerImpl.java
解决方法:
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>struts-default.xml,struts-plugin.xml,struts2/struts-*.xml</param-value>
</init-param>
</filter>
即,必须添加
struts-default.xml(必须),struts-plugin.xml(可选)二个额外的配置文件.
原因:
struts-default.xml是默认配置文件,一些必须的框架参数都默认设置在此.
相关文章推荐
- sublime text3修改默认配置文件是失败的解决方法
- Info.plist与Prefix.pch修改文件位置遇到的问题及解决方法
- MySQL配置文件无法修改的解决方法(Win10)
- ubuntu12.04 修改mysql配置文件my.cnf编码出错---解决方法
- Struts2中default.properties常量默认配置文件详解,以及修改常量方式
- ueditor上传图片时目录创建失败的问题解决方法,不用那么麻烦,其实修改php/config.json这个配置文件里面的路径就行!!
- ubuntu12.04 修改mysql配置文件my.cnf编码出错---解决方法
- Tips3:Info.plist与Prefix.pch修改文件位置遇到的问题及解决方法
- Info.plist与Prefix.pch修改文件位置遇到的问题及解决方法
- 修改Struts2的struts.xml配置文件位置
- Info.plist与Prefix.pch修改文件位置遇到的问题及解决方法
- 关于电脑误删摸个配置文件导致系统异常的解决方法(知道误删的什么文件)
- 如何修改用户配置文件默认位置
- 修改Struts2的struts.xml配置文件位置
- win7下文件无法修改默认程序之解决方法
- Info.plist与Prefix.pch修改文件位置遇到的问题及解决方法
- filezilla 配置文件 在哪里?原来配置文件位置修改如此简单,绿色实用的方法
- 修改Struts2的struts.xml配置文件位置
- Windows XP如何修改用户配置文件默认位置
- 大文件上传,修改php.ini的配置之后仍不生效解决方法