Error creating bean with name 'org.springframework.context.annotation.internalRequiredAnnotationProc
来源:互联网 发布:c语言bzero 编辑:程序博客网 时间:2024/04/30 11:41
异常信息: xml 文件配置注解时报错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalRequiredAnnotationProcessor': BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: warning no match for this type name: cn.itcast.service.imple.AopServiceBean3 [Xlint:invalidAbsoluteTypeName]
原因:
applicatonContext.xml
<aop:config>
<aop:aspect id="asp" ref="myInterceptor1">
<!-- <aop:pointcut id="mycut" expression="execution(* cn.itcast.service.imple.AopServiceBean3..*(..))" />--> 正确的
<!-- <aop:pointcut id="mycut" expression="execution(* cn.itcast.service.imple.AopServiceBean3.*.*(..))" />-->正确的
<aop:pointcut id="mycut" expression="execution(* cn.itcast.service.imple.AopServiceBean3..*.*(..))" />正确的
<!--下面的配置有问题 AopServiceBean3.*(..) -->
<!-- <aop:pointcut id="mycut" expression="execution(* cn.itcast.service.imple.AopServiceBean3.*(..))" />-->错误的
<aop:before method="doAccessCheck" pointcut-ref="mycut"/>
</aop:aspect>
如用注解:
@Pointcut("execution (* cn.itcast.aop.service.imple..*.*(..))") //imple包下所有类的所有方法进行拦截
// @Pointcut("execution (* cn.itcast.aop.service.imple.AopServiceBean2.*(..))")只对AopServiceBean2类下方法进行拦截
有一个问题没有搞明白:为什么注解和配置一样会报错?
annotation:::::::<!-- <aop:pointcut id="mycut" expression="execution(* cn.itcast.service.imple.AopServiceBean3.*(..))" />-->错误的
xml::::::::::::::::::::// @Pointcut("execution (* cn.itcast.aop.service.imple.AopServiceBean2.*(..))")只对AopServiceBean2类下方法进行拦截 正确的
参考文章:
http://hi.baidu.com/gglzf4/blog/item/424bd5d761d23b2006088b1b.html
http://blog.csdn.net/sustbeckham/article/details/5819213
- Error creating bean with name 'org.springframework.context.annotation.internalRequiredAnnotationProc
- Error creating bean with name 'org.springframework.context.annotation.internalRequiredAnnotationProc
- Error creating bean with name 'org.springframework.context.annotation.internalAsyncAnnotationProcess
- maven springmvc Error creating bean with name 'org.springframework.web.servlet.mvc.annotation
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name '***'
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBe
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- Error creating bean with name 'org.springframework.validation.beanvalidation.OptionalValidatorFactor
- Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBe
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- org.springframework,beans.factory.BeanCreationException:error creating bean with name ***
- appweb3.3.1如何使用EJS调用自己的C函数(ubuntu10.04)
- C++语言设计
- loadNibNamed 的使用
- GCC后端及汇编发布(41)
- 模拟实现WPF的依赖属性及绑定通知机制(4)--模拟实现绑定连动机制
- Error creating bean with name 'org.springframework.context.annotation.internalRequiredAnnotationProc
- GCC's bacl-end & assemble emission (41)
- java 冒泡排序
- 《UNIX IO---再谈文件描述符》
- HDU 3313 Key Vertex 胡搞(网络流最小割拆点什么的人家才不会呢)
- 使用FileUpload上传文件并向数据库插入一条记录
- 数据归档的发展潜力
- Java类集 _List接口
- UIView中的常用方法