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

报了这个错误

Unable to instantiate Action, roomtypeAction,  defined for 'roomtypeAction' in namespace '/'roomtypeAction

上网找了好久才发现原来原因是这个:

找不到 applicationContext.xml 中 bean id="xxxxx"

解决办法:

首先确认下 applicationContext.xml 文件存放路径

如果 applicationContext.xml 存入在 src 目录下 , 请在 web.xml 中添加如下配置:

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml,classpath*:/context/applicationContext*.xml</param-value>
</context-param>

如果 applicationContext.xml 存入在 WEB-INF 目录下,请在web.xml下删掉或注释掉以下配置:

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml,classpath*:/context/applicationContext*.xml</param-value>
</context-param>

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

  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. 报错HTTP Status 500 - Unable to instantiate Action

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

  9. struts2整合spring出现的Unable to instantiate Action异常

    在struts2整合spring的时候,完全一步步按照官方文档上去做的,最后发现出现 Unable to instantiate Action,网上一搜发现很多人和我一样的问题,配置什么都没有错误,就 ...

随机推荐

  1. 内训--2小时 Word精髓

    企业内部使用Word最常见就是用来写产品手册与合同,产品手册是书版(即可以出版,与买到的书类似),合同重点是修订.Word的精髓在于样式,或者说在企业办公使用,学会样式就可以了.什么域.宏.VBA几乎 ...

  2. Hive环境的安装

    hive是什么:hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供简单的sql查询功能(HQL) hive有什么用 1.通过类SQL语句快速实现简单的Map ...

  3. Java内存列表

    当jvm运行起来的时候,它会向系统申请一片内存区,并将这块内存分出一部分存储程序创建的对象,传递给方法的参数,返回值,局部变量等等,我们将这块内存称之为“运行时数据区”. 初学的时候把Java内存分为 ...

  4. suricata 配置文件threshold

    threshold threshold(阈值)关键字可用于控制规则的警报频率,它有3种模式: threshold: type <threshold|limit|both>, track & ...

  5. 安装zabbix3.4 centos7

    服务端 192.168.70.133 客户端 192.168.70.134 sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc ...

  6. tensorflow报错error,tf.concat Expected int32, got list containing Tensors of type '_Message' instead

    参考:https://stackoverflow.com/questions/41813665/tensorflow-slim-typeerror-expected-int32-got-list-co ...

  7. 作业注释 CSS表单1 输入框前有图片

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  8. SpringMVC 中模型数据处理中的@ModelAttribute 和@SessionAttributes使用细节

    @ModelAttribute 运用在参数上,会将客户端传递过来的参数按名称注入到指定对象中,并且会将这个对象自动加入ModelMap中,便于View层使用(在方法中修改了入参值在view层得到的还是 ...

  9. extern和include的作用

    首先要搞清楚的是.h头文件中都是一些声明性的语句,是不分配内存的,所以头文件中有对函数的声明,有define语句,有没有实例化的结构体定义,但是没有对变量的定义(比如 int a),有的只是对外变量的 ...

  10. weld

    weld - 必应词典 美[weld]英[weld] v.焊接:熔接:锻接:使紧密结合 n.焊接点:焊接处 网络焊缝