Why aspect j can't weave show Xlint cantFindType

北城余情 提交于 2019-12-05 08:54:59

It seems that you are trying to weave 3rd party classes which probably shouldn't be weaved.

You should probably restrict weaving to your packages in META-INF/aop.xml something like this:

<?xml version="1.0"?>

<!--
    AspectJ load-time weaving config file with Spring aspects.
-->
<aspectj>


    <weaver options="-showWeaveInfo">
        <include within="com.yourpackage..*"/>
    </weaver>


    <aspects>
        <aspect name="org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect"/>
        <aspect name="org.springframework.scheduling.aspectj.AnnotationAsyncExecutionAspect"/>
        <aspect name="org.springframework.transaction.aspectj.AnnotationTransactionAspect"/>
        <aspect name="org.springframework.cache.aspectj.AnnotationCacheAspect"/>
    </aspects>

</aspectj>

Where <include within="com.yourpackage..*"/> is restriction to your packages.

Add the following as dependency in your pom.xml file.

<dependencies>
     <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-tx</artifactId>
         <version>3.2.3.RELEASE</version>
     </dependency>
</dependencies>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!