`
zhb8015
  • 浏览: 396817 次
  • 性别: Icon_minigender_1
  • 来自: 北京
博客专栏
Group-logo
Spring Roo杂谈
浏览量:0
社区版块
存档分类
最新评论

Error creating bean with name 'org.springframework.context.annotation.internalRequiredAnnotationProc

 
阅读更多

异常信息: 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

分享到:
评论

相关推荐

    spring-web-2.5.jar

    org.springframework.web.bind.annotation.SessionAttributes.class org.springframework.web.bind.support.ConfigurableWebBindingInitializer.class org.springframework.web.bind.support....

    org.springframework.core.jar

    5. **排序与比较**:`org.springframework.core.order`和`org.springframework.core.type`包提供了排序算法和类型比较机制,对于Spring容器中bean的排序和类型检查起到了关键作用。 6. **事件驱动**:`org.spring...

    spring-mock.jar

    org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.class org.springframework.test.annotation.DirtiesContext.class org.springframework.test.annotation.ExpectedException.class...

    org.springframework.core_3.1.1.RELEASE.jar

    6. `org.springframework.core.annotation`: 包含了对Java注解的处理,如`MergedAnnotations`接口,用于合并和检索注解信息,是Spring元数据解析的关键部分。 7. `org.springframework.core.type`: 提供了类型扫描...

    org.springframework.test-3.0.2.RELEASE.jar

    import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @...

    org.springframework.orm.hibernate3.LocalSessionFactoryBean

    ### 关于 "org.springframework.orm.hibernate3.LocalSessionFactoryBean" 未找到问题的知识点解析 #### 一、问题背景 在开发基于Spring与Hibernate整合的应用时,可能会遇到“`org.springframework.orm.hibernate...

    org.springframework.web.servlet-3.0.5.RELEASE.jar

    spring mvc 开发的必须有的架包org.springframework.web.servlet-3.0.5.RELEASE.jar

    org.springframework.dao.InvalidDataAccessApiUsageException

    ### 关于 `org.springframework.dao.InvalidDataAccessApiUsageException` 的深入解析 在Spring与Hibernate集成开发过程中,开发者可能会遇到各种各样的异常问题。其中一种较为常见的异常是 `org.springframework....

    org.springframework.web.servlet-3.0.0.M4.jar

    org.springframework.web.servlet-3.0.0.M4.jar

    springAOP demo 带错误解决文档

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.config.internalAutoProxyCreator': Instantiation of bean failed; nested exception is org....

    org.springframework.transaction-3.0.0.M4.jar

    org.springframework.transaction-3.0.0.M4.jar

    关于springboot我出过的那些错误.docx

    错误五:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping' 错误原因:...

    spring开发中的jar包,json,annotation

    The import org.springframework.web.bind.annotation cannot be resolved. json.jar spring.jar mail.jar log4j.jar

    No1WMS-master WMS JAVA

    import org.springframework.context.annotation.Bean; import org.springframework.web.filter.HiddenHttpMethodFilter; @SpringBootApplication public class WmsApplication { public static void main(String...

    asm-3.2.3.jar

    org.springframework.beans.annotation org.springframework.beans.factory org.springframework.beans.factory.access org.springframework.beans.factory.access.el org.springframework.beans.factory.annotation...

    org.springframework.osgi.extensions.annotation-1.2.1.jar

    org.springframework.osgi.extensions.annotation-1.2.1.jar

    spring_MVC源码

    14. &lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /&gt; 15. 16. &lt;!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 --&gt; 17. &lt;bean class="org....

    redis-lock-master.zip

    import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java....

    springmvc-ibatis

    &lt;bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /&gt; &lt;!-- 匹配...

    org.aspectj.lang.annotation.Around所需要的包

    在Java编程环境中,有时我们可能会遇到“java.lang.ClassNotFoundException: org.aspectj.lang.annotation.Around”的错误,这通常意味着运行时环境无法找到特定的类,即`org.aspectj.lang.annotation.Around`。...

Global site tag (gtag.js) - Google Analytics