Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why aspect j can't weave show Xlint cantFindType

I have write a aspectj class,and i want weave by autodetect like

but it's does't effect. show some errors:

[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.dispatcher.RequestMap
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.dispatcher.SessionMap
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.util.AttributeMap
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.BooleanUtils
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type ognl.ASTChain
when weaving classes 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type ognl.enhance.OrderedReturn
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.util.reflection.ReflectionContextState
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type ognl.Evaluation
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.dispatcher.mapper.ParameterAction
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving classes 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.util.PrefixTrie$Node
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.dispatcher.mapper.DefaultActionMapper$2$1
when weaving classes 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.dispatcher.mapper.DefaultActionMapper$2$2
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.dispatcher.mapper.DefaultActionMapper$2$3
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.dispatcher.mapper.DefaultActionMapper$2$4
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.RequestUtils
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.util.profiling.UtilTimerStack
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.DefaultActionInvocation
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.ActionEventListener
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.UnknownHandler
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.impl.StrutsActionProxy
when weaving classes 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.DefaultActionProxy
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.StringEscapeUtils
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.CharSequenceTranslator
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.AggregateTranslator
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.StringEscapeUtils$CsvEscaper
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.StringEscapeUtils$CsvUnescaper
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.LookupTranslator
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.EntityArrays
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.ArrayUtils
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.UnicodeEscaper
when weaving classes 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.CodePointTranslator
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.OctalUnescaper
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.UnicodeUnescaper
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.NumericEntityUnescaper
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.commons.lang3.text.translate.NumericEntityUnescaper$OPTION
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.interceptor.ServletRequestAware
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.interceptor.ServletResponseAware
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.interceptor.ParameterAware
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.interceptor.ApplicationAware
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.interceptor.SessionAware
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.interceptor.RequestAware
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.interceptor.PrincipalAware
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.util.ServletContextAware
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.interceptor.MethodFilterInterceptorUtil
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.Preparable
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.interceptor.ScopedModelDriven
when weaving classes 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.ModelDriven
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.config.entities.Parameterizable
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.interceptor.ParameterNameAware
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type org.apache.struts2.interceptor.validation.SkipValidation
when weaving classes 
when weaving 
 [Xlint:cantFindType]
[TomcatInstrumentableClassLoader@14d659d] error can't determine annotations of missing type org.springframework.transaction.annotation.Transactional
when weaving type com.opensymphony.xwork2.util.AnnotationUtils
when weaving classes 
when weaving 
 [Xlint:cantFindType]
like image 695
nabilzhang Avatar asked Sep 17 '13 13:09

nabilzhang


2 Answers

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.

like image 144
Ondrej Bozek Avatar answered Nov 15 '22 20:11

Ondrej Bozek


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>
like image 25
MichaelZ Avatar answered Nov 15 '22 22:11

MichaelZ