Unable to instantiate Action, xxxAction, defined for ‘xxx’ in namespace ‘/’xxxAction

Unable to instantiate Action, xxxAction, defined for ‘xxx’ in namespace ‘/’xxxAction解决方案

2014年09月05日 ? 综合 ? 共 401字 ? 字号 ? 评论关闭

出现这个问题的原因主要有两个

1、如果项目没有使用Spring,则struts.xml配置文件中,这个action的class属性的路径没有写完整,应该是包名.类名

2、如果项目使用了Spring,那就是applicationContext.xml里面没有为这个action定义bean。这样strus.xml中的对应action的class属性的值就是Spring配置文件中bean的id,比如:

applicationContext.xml

<bean id="adminAction" class="go.derek.action.AdminAction"
	scope="prototype">
	</bean>

struts.xml

<action name="admin" class="adminAction" method="execute">
			<result>/admin.jsp</result>
		</action>
3.补充也可能是@Controller("UnitAction") Unit大小写问题
时间: 2024-08-24 13:18:57

Unable to instantiate Action, xxxAction, defined for ‘xxx’ in namespace ‘/’xxxAction的相关文章

Unable to instantiate Action, xxxAction, defined for &#39;xxx&#39; in namespace &#39;/&#39;xxxAction解决方案

出现这个问题的原因主要有两个 1.如果项目没有使用Spring,则struts.xml配置文件中,这个action的class属性的路径没有写完整,应该是包名.类名 2.如果项目使用了Spring,那就是applicationContext.xml里面没有为这个action定义bean.这样strus.xml中的对应action的class属性的值就是Spring配置文件中bean的id,比如: applicationContext.xml <bean id="adminAction&qu

2.Unable to instantiate Action, templateAction, defined for &#39;template_list&#39; in namespace &#39;/&#39;templateAction

1.错误说没有命名空间'templateAction,但是在struts里写了这个,名字跟Action的名字是一样的,为什么会报这个错误 2.反复检查路径和名字,都没有问题 3.发现没有对其进行注入操作,所以一定要记得注入 2.Unable to instantiate Action, templateAction, defined for 'template_list' in namespace '/'templateAction

Unable to instantiate Action, MenuAction, defined for &#39;QueryMenuAll&#39; in namespace &#39;/&#39;MenuAction

我刚好也遇到这样的情况,发现是自己的配置文件里写错了,spring里的id属性值要对应struts里class属性值. Unable to instantiate Action, MenuAction, defined for 'QueryMenuAll' in namespace '/'MenuAction

Unable to instantiate Action, xxxAction, defined for &amp;#39;xxx&amp;#39; in namespace &amp;#39;/&amp;#39;xxxAction解决方式

出现这个问题的解决办法主要有两个 1.假设项目没有使用Spring,则struts.xml配置文件里,这个action的class属性的路径没有写完整,应该是包名.类名 2.假设项目使用了Spring.那就是applicationContext.xml里面没有为这个action定义bean.这样strus.xml中的相应action的class属性的值就是Spring配置文件里bean的id.比方: applicationContext.xml <bean id="adminAction&

Unable to instantiate Action异常

严重: Exception occurred during processing request: Unable to instantiate Action, SsbkAction,  defined for 'SsbkAction' in namespace ''Error creating bean with name 'SsbkAction' defined in file [D:\Program Files (x86)\Liuhe\code\myeclipse 2014 code\.me

运行ssh项目出现&quot;HTTP Status 500 - Unable to instantiate Action&quot;

开始整合ssh框架报的错: HTTP Status 500 - Unable to instantiate Action, employeeAction, defined for 'show' in namespace '/'Error creating bean with name 'employeeAction' defined in file [E:\javaTools\apache-tomcat-8.0.15\webapps\ssh\WEB-INF\classes\bean-action

Unable to instantiate Action, xxxAction, defined for &#39;showBlogDetails&#39;

(忘了截图错误信息...) 使用SSH框架配置applicationContext.xml与struts.xml之间的映射关系 解决方案:保证applicationContext.xml中注册的bean元素的name属性名与struts.xml的action元素的class属性名一致,但我这里有点奇怪,我之前使用的blogActionBean不行,要换成blogAction才行,也许是语法限制? Unable to instantiate Action, xxxAction, defined f

spring与struts2整合出现错误HTTP Status 500 - Unable to instantiate Action

在进行spring和struts2整合的时候因为大意遇到了一个问题,费了半天神终于找到了问题所在,故分享出来望广大博友引以为戒!! 我们都知道在spring和struts2整合时,spring接管了action对象的创建,所以一定要在spring配置文件中配置action,这里需要注意的是配置<bean id="???">中的id时, 要与struts.xml配置action中的<action class="???">class一致,否则就会

No result defined for action com.action.Actionxxx and result xxx

报错:No result defined for action com.action.Actionxxx and result xxx 刚学Struts2不久,写的第一个Action就遇到这个问题,有两个原因: 1.Action类类名命名不能使用数字,如:Action1,服务器启动不报错,但访问Action1并运行其方法时,无法找到配置好的Result,即在映射过程中会丢失return的值.(注意:Action类类名命名不能使用Action,以免和框架中的特殊词混淆而导致服务器启动过程中报错)