No mapping found for dependency

qq_26129731 2016-10-20 12:01:04
错误信息:java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException,

No mapping found for dependency [type=com.opensymphony.xwork2.conversion.ConversionFileProcessor, name='default'] in public void com.opensymphony.xwork2.conversion.impl.XWorkConverter.setConversionFileProcessor(com.opensymphony.xwork2.conversion.ConversionFileProcessor).



其中struts.xml就放在src目录下



web.xml里的内容如下

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>test</display-name>
<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>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</context-param>
</web-app>



其中<init-param></init-param>标签及里面的内容去掉也是报同样的错误。



...全文
689 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tao.xing 2016-10-20
  • 打赏
  • 举报
回复
struts.xml 继承struts-default没有<package name="shop" extends="struts-default" >
qq_26129731 2016-10-20
  • 打赏
  • 举报
回复
引用 2 楼 qq_26129731的回复:
继承了,谢谢你帮我解决问题,我找到问题了,是在网上下载的那个struts-core.jar有问题,不知道是版本的问题还是这个包自身的问题,他的struts-default里面少写了下图高亮的那两个bean
好像看不到图......
qq_26129731 2016-10-20
  • 打赏
  • 举报
回复
继承了,谢谢你帮我解决问题,我找到问题了,是在网上下载的那个struts-core.jar有问题,不知道是版本的问题还是这个包自身的问题,他的struts-default里面少写了下图高亮的那两个bean

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧