`
chainhou
  • 浏览: 172281 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Struts2 Dispatcher initialization failed No mapping found for dependency default

阅读更多
在struts2的使用时如果发现以下异常信息,
严重: Dispatcher initialization failed
com.opensymphony.xwork2.inject.DependencyException: 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).


可能原因是:你在web.xml中重新指定了struts.xml的位置,导致struts.xml需要使用的struts-default.xml无法找到。
解决方式是在web.xml中也添加struts-default.xml,如下:
 <filter>
		<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,struts.xml</param-value>
		</init-param>
	</filter>


param-value项指定了需要的文件。
分享到:
评论

相关推荐

    org.apache.struts2.dispatcher.FilterDispatcher

    org.apache.struts2.dispatcher.FilterDispatcher

    Struts2_s2-016&017&ognl2.6.11_patch漏洞补丁

    &lt;bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="myDefaultActionMapper" class="com.struts2.MyDefaultActionMapper" /&gt; &lt;constant name="struts.mapper.class" value=...

    struts2上传必备jar包,避免出现struts2的升级漏洞!自己吃亏后分享

    at org.apache.struts2.dispatcher.Dispatcher.cleanUpRequest(Dispatcher.java:837) at org.apache.struts2.dispatcher.ng.PrepareOperations.cleanupRequest(PrepareOperations.java:103) at org.apache.struts2....

    Struts课堂笔记.rar--struts2的struts.properties配置文件详解

    The org.apache.struts2.dispatcher.multipart.MultiPartRequest parser implementation for a multipart request (file upload) 专为multipart请求信息使用的org.apache.struts2.dispatcher.multipart....

    Struts2入门教程(全新完整版)

    org.apache.struts2.dispatcher.ServletActionRedirectResult 16 plainText 16 显示源文件内容,如文件源码 16 org.apache.struts2.dispatcher.PlainTextResult 16 freemarker 16 处理FreeMarker模板 16 org.apache....

    struts 2.2 api文档

    org.apache.struts2, org.apache.struts2.components, org.apache.struts2.components.template, org.apache.struts2.config, org.apache.struts2.dispatcher, org.apache.struts2.dispatcher.mapper, org.apache....

    struts2 + spring + mybatis 框架整合jar包

    &lt;filter&gt;&lt;filter-name&gt;struts2&lt;/filter-name&gt;&lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt;&lt;/filter&gt;&lt;filter-mapping&gt;&lt;filter-name&gt;struts2&lt;/filter-name&gt;...

    解决struts2下载异常的jar包 struts2-sunspoter-stream-1.0.jar

    -- 添加如下内容 --&gt; &lt;result-types&gt; &lt;result-type name="streamx" class="com.sunspoter.lib.web.struts2.dispatcher.StreamResultX"/&gt; &lt;/result-types&gt; &lt;action name="download" class="com.DownloadAction"&gt; &lt;!...

    Struts2属性文件详解

    该属性的默认值是org.apache.Struts2.config.DefaultConfiguration, 这是Struts 2默认的配置文件管理器.如果需要实现自己的配置管理器,开发者则可以实现一个实现Configuration接口的类,该类可以自己加载Struts 2配置...

    Struts2整合SiteMesh技巧

    &lt;filter-class&gt;org.apache.struts2.dispatcher.ActionContextCleanUp&lt;/filter-class&gt; filter&gt; &lt;filter&gt; &lt;filter-name&gt;sitemesh&lt;/filter-name&gt; &lt;filter-class&gt;...

    xml里filter-mapping中的dispatcher的使

    xml里filter-mapping中的dispatcher的使

    Struts2+Spring3+MyBatis3完整实例

    网上的东西好大多都不能直接用,自己结合网上资料做了一个Struts2+Spring3+MyBatis3的测试工程,JUnit测试用例和WEB服务。 内涵完整jar包,解压直接可用,包括一个表文件。 Eclipse3.2+Tomcat/5.5+jdk1.5.0_17 - ...

    新struts2+jQuery所需包.rar

    &lt;filter-class&gt;org.apache.struts2.dispatcher.FilterDispatcher, 新版本中都是过时的了,采取该过滤器, &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter。

    Struts2 in action中文版

    第1章 Struts 2:现代Web框架 2 1.1 Web应用程序:快速学习 2 1.1.1 构建Web应用程序 2 1.1.2 基础技术简介 3 1.1.3 深入研究 6 1.2 Web应用程序框架 7 1.2.1 什么是框架 7 1.2.2 为什么使用框架 8 1.3 Struts 2框架...

    Apache的Struts2框架严重安全漏洞

    Apache的Struts2框架最近出了一个很严重的漏洞,可以直接执行系统命令 http://www.163.com?%28%27\u0023_memberAccess[\%27allowStaticMethodAccess\%27]%27%29%28meh%29=true&%28aaa%29%28%28%27\u0023context[\%27...

    struts2配置2.5版

    org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter &lt;filter-mapping&gt; &lt;!-- 拦截所有的url --&gt; &lt;filter-name&gt;struts2 &lt;url-pattern&gt;/* &lt;/filter-mapping&gt; &lt;/web-app&gt;

    传智播客struts2全程学习笔记

    传智播客struts2开源框架全程跟踪学习笔记,可以有效的提高对struts2框架的新认识和使用,更有效的提高开发效率!

    struts-2.5.13

    &lt;filter-class&gt;org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt; &lt;!-- 引用个具体类文件 --&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;struts2&lt;/filter-name&gt; ...

    SSH2报错xception starting filter struts2

    严重: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

    Struts2基本框架搭建jar包

    &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter &lt;filter-mapping&gt; &lt;filter-name&gt;struts2&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt;

Global site tag (gtag.js) - Google Analytics