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

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

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

applicationContext.xml

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

struts.xml

  1. <action name="admin" class="adminAction" method="execute">
  2. <result>/admin.jsp</result>
  3. </action>

Unable to instantiate Action, xxxAction, defined for 'xxx' in namespace '/'xxxAction解决方案的更多相关文章

  1. SSH Spring3\Java1.8 “Unable to instantiate Action, xxAction, defined for 'xxAction_login' in namespace '/'null”

    1.Stacktraces Unable to instantiate Action,xxAction, defined for 'xxAction_login' in namespace '/'nu ...

  2. SSH整合:Unable to instantiate Action, employeeAction, defined for 'emp-list' in namespace '/'employeeAction - action

    SSH整合,照着视频敲的,不知为何会报错,经历了快两周的折磨给解决了.记录下来给后面需要帮助的人,也算极好的了. Struts Problem Report Struts has detected a ...

  3. SSH整合报错:Unable to instantiate Action, testAction, defined for 'test' in namespace '/'testAction

    报错如下: Struts Problem Report Struts has detected an unhandled exception: Messages: testAction Unable ...

  4. 出现"Unable to instantiate Action,xxxxx, defined for 'login' in namespace '/' xxxxx 解决办法

    转自:https://blog.csdn.net/heroful/article/details/17261169 问题原因: 在MyEclipse 利用SSH框架写程序,运行时出现 " U ...

  5. 2.Unable to instantiate Action, templateAction, defined for 'template_list' in namespace '/'templateAction

    1.错误说没有命名空间'templateAction,但是在struts里写了这个,名字跟Action的名字是一样的,为什么会报这个错误 2.反复检查路径和名字,都没有问题 3.发现没有对其进行注入操 ...

  6. Unable to instantiate Action, MenuAction, defined for 'QueryMenuAll' in namespace '/'MenuAction

    我刚好也遇到这样的情况,发现是自己的配置文件里写错了,spring里的id属性值要对应struts里class属性值.

  7. HTTP Status 500 - Unable to instantiate Action, customerAction, defined for 'customer_toAddPage' i

    使用struts2时碰到这样的错误 HTTP Status 500 - Unable to instantiate Action, customerAction, defined for 'custo ...

  8. Unable to instantiate Action, xxxAction, defined for 'xxxAction' in namespace '/'xxx

    最近写SSH2的项目时,遇到一些小问题,action得不到service实例,遂将struct2委托给spring进行管理,然后修改了bean的id和action的class,但是运行后发现找不到ac ...

  9. 报错HTTP Status 500 - Unable to instantiate Action

    报错如下: HTTP Status 500 - Unable to instantiate Action, visitAction, defined for 'visit_toAddPage' in ...

随机推荐

  1. 2019冬季PAT甲级第二题

    #define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; typedef struct{ int ...

  2. 清晰架构(Clean Architecture)的Go微服务: 程序设计

    我使用Go和gRPC创建了一个微服务,并将程序设计和编程的最佳实践应用于该项目. 我写了一系列关于在项目工作中做出的设计决策和取舍的文章,此篇是关于程序设计. 程序的设计遵循清晰架构(Clean Ar ...

  3. 03-Spring的IOC示例程序(通过类型获取对象)

    根据bean类型从IOC容器中获取bean的实例 ①test测试类 @Test public void Test02() { //获取spring容器对象 ApplicationContext app ...

  4. 8.5-Day1T2--Asm.Def 的基本算法

    题目大意 给一棵树,求∑∑w_i*w_j*w_LCA(i,j) w_i表示i点权值 题解 显然一点点求lca是肯定会tle的 那就想如何优化 i和j的lca和j和i的lca是一样的 DFS,在每个x处 ...

  5. 制作PPT时的一些技巧记录

    1.当一页PPT上有很多图片,要选择其中一张图片时,发现图片都重叠了,不好选择时该怎么办? 2.对动画的编辑 技巧:与选择窗口配合使用

  6. java 实现一段文字中,出现次数最多的字

    代码如下: public static void main(String[] args) { String str = "大批量,之前都没怎么注意过,这个问题确实不会,网上参考了下别人的,大 ...

  7. CentOS 7----Apache基于域名的虚拟主机配置

    配置/etc/hosts文件,192.168.1.209 对应的域名如下: 192.168.1.209 www.name1.com 编辑每个域名的配置文件: <VirtualHost 192.1 ...

  8. 2020年一线大厂月薪35K的Python开发要求

    为什么程序员要在2020年学习Python? 如果你正在考虑学习 Python,但又不确定为什么要这样做的话,那么你可以看看以下的内容: 马蜂窝裁员竟然达到了40%, 前段时间猪厂.菊厂裁员被推到了风 ...

  9. CSS - px、em、%

    px(像素).em.% 百分比 1. em 1.1 本元素给定字体的 font-size 值,如果元素的 font-size 为 14px ,那么 1em = 14px:如果 font-size 为 ...

  10. C:变量的声明与定义

    声明变量不需要建立存储空间,如:extern int a; 定义变量需要建立存储空间,如:int b; #include <stdio.h> int main() { //extern 关 ...