HTTP Status 500 - Unable to instantiate Action, customerAction, defined for 'CustomerAction_list' in

9 篇文章 1 订阅

HTTP Status 500 - Unable to instantiate Action, customerAction, defined for ‘CustomerAction_list’ in namespace ‘/’customerAction

1.在applicationContext.xml中没有开启注解(如果是xml注解配置,无需开启)

<context:annotation-config/>

2.或者没有

<context:context-scan/>

注解说明
• 注册注解处理器

• 方式一:bean

<bean class="org.springframework.beans.factory.annotation.
AutowiredAnnotationBeanPostProcessor"/>

• 方式二: 命名空间 <context:annotation-config/>

<context:annotation-config />将隐式地向Spring
容器注册AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor
、 PersistenceAnnotationBeanPostProcessor
以及RequiredAnnotationBeanPostProcessor 这4 个BeanPostProcessor 。

• 方式三: 命名空间<context:component-scan />

如果要使注解工作,则必须配置component-scan ,实际上不需要再配置annotation-config。 base-package
属性指定了需要扫描的类包,类包及其递归子包中所有的类都会被处理。还允许定义过滤器将基包下的某些类纳入或排除。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值