com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$Mis

为什么会出现这个错误?

我使用了Maven配置Struts,所以修改Struts配置文件的默认路径,如下:

<!-- 配置struts -->
	<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>../../resources/struts.xml</param-value>
		</init-param>
	</filter>

	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>*.cgi</url-pattern>
	</filter-mapping>

由于不是默认录了, 一些框架需要的参数无法加载。

解决办法:

修改

<param-value>../../resources/struts.xml</param-value>为
<param-value>struts-default.xml,struts-plugin.xml,../../resources/struts.xml</param-value>

struts-default.xml(必须),struts-plugin.xml(可选)

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-10-08 14:23:30

com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$Mis的相关文章

struts配置文件修改路径报错

今天在整合spring+struts时,把struts2的配置文件放到src/config/struts/struts.xml,启动项目老是报错!web下struts拦截器配置如下: <!-- 定义Struts2的核心Filter --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsP

关于Struts2中struts.xml文件分层问题

没事折腾struts2,遇到异常,浪费好长时间,于是干脆把所有可能的异常都给跑一遍,来个痛快的. 文件的结构 WEB-INF |------configs |-------struts-common.xml |-------struts.xml |------web.xml 遇到的异常: WARNING: Could not find action or result: /Pro_struts2/common/login!preLogin There is no Action mapped fo

Struts 2.x 与Spring4.x整合出现:No mapping found for dependency [type=java.lang.String, name=&#39;actionPackages...

Struts2.16与Spring4.x整合出错: Caused by: java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name

spring3+struts2+hibernate3整合出现的问题,No mapping found for dependency [type=java.lang.String, name=&#39;struts.objectFactory.spring.enableAopSupport&#39;]

七月 11, 2016 3:49:24 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:EBook' did not find a matching property.七月 11, 2016 3:4

google guice @inject comments

refer this document: http://blog.chinaunix.net/uid-20749563-id-718418.html @Inject注入方式,用@Inject来标识那个方法被注入 @ImplementedBy(Class)的注释方式.可以直接从你的接口指向一个缺省的实现,而省略掉对com.google.inject.Module的实现.其实这样就违背了多态的原则,一般使用较少,最后还是把控制权交给Module来处理. 当 Guice 找到注释时,它会挑选构造函数参

[Angular 2] Inject Service

TypeScript is used heavily as we build up our application, but TypeScript isn’t required. If you want to Inject a Service without using TypeScript, you’ll need to understand the @Inject decorator. import {Component, View, Inject} from "angular2/angul

Guice 学习(七)常量和属性的注入( Constant and Property Inject)

1.常量注入方式 package com.guice.ConstantInjectDemo; import com.google.inject.Binder; import com.google.inject.Guice; import com.google.inject.Inject; import com.google.inject.Module; import com.google.inject.name.Named; import com.google.inject.name.Names

Guice 学习(六)使用Provider注入服务( Provider Inject Service)

1.定义接口 package com.guice.providerInject; import com.google.inject.ProvidedBy; public interface Service { public void execute(); } 2.定义实现类 package com.guice.providerInject; public class OneService implements Service { @Override public void execute() {

Guice 学习(二)构造器注入(Constructor Inject)

为了演示下面的支持多参数的构造函数注入,我在这里写了2个接口和其实现类.注意事项写在了程序注释里面. 1.接口 (interface) /* * Creation : 2015年6月30日 */ package com.guice.constructorInject; import com.google.inject.ImplementedBy; @ImplementedBy(ServiceImpl.class) public interface Service { public void ex