paul cla
paul cla

Reputation: 31

spring aspectj my classes are not weaved

I am using spring release 4.1.4. I am also using axis2.

Here is my aop.xml

<!DOCTYPE aspectj PUBLIC 
"-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
    <weaver options="-verbose -debug -showWeaveInfo">
        <!-- only weave classes in our application-specific packages -->
        <include within="com.alu.motive.smdm.mediation.process.orchestration.process.*" />
        <include within="com.alu.motive.smdm.mediation.process.orchestration.activity.*" />
    </weaver>
    <aspects>
        <aspect name="com.alu.motive.smdm.mediation.process.orchestration.process.TransitionGovernorAspect" />
    </aspects>
</aspectj> 

here is my jvm args (i am suing Tomcat 8):

-Dcatalina.base="C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0" -Dcatalina.home="C:\Tomcat\apache-tomcat-8.0.18" -Dwtp.deploy="C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps" -Djava.endorsed.dirs="C:\Tomcat\apache-tomcat-8.0.18\endorsed" -javaagent:"C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\spring-instrument-4.1.4.RELEASE.jar" -XX:-UseSplitVerifier

Here is my application context:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <!-- will register load time weaver needed to weave Aspect which controls activity transition,
         TransitionGovernorAspect  -->
    <context:load-time-weaver/>

    <!--  PART 1 – Process Assembly -->
    <aop:config>
        <!-- we are using "bean" pointcut in conjunction with execution pointcut  
             which will allow us to assemble some other process from another instance of
             GenericProcessImpl -->
        <aop:pointcut id="serviceToAssociatePointcut" 
            expression="bean(serviceToAssociate) and 
                execution(void com.alu.motive.smdm.mediation.process.orchestration.process.GenericProcessImpl.execute(..))"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="validateServiceDataFlter" order="1"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="associateServiceInM2MFlter" order="2"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="storeSessionStepFlter" order="3"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="retryFlter" order="4"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="processAsyncResponseFlter" order="5"/>
        <aop:advisor pointcut-ref="serviceToAssociatePointcut" 
                                                advice-ref="processAsyncErrorResponseFlter" order="6"/>
    </aop:config>

    <!--  PART 2 – Activity Interceptors (Filters) Configuration -->
    <!--  Individual Intercepting filters wired with corresponding 
          Activities and simple Fact rules-->
    <bean id="genericFlter" class="com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor" 
                                                            abstract="true"/>
    <bean id="validateServiceDataFlter" parent="genericFlter">
        <constructor-arg ref="validateServiceDataActivity"/>
        <property name="facts" value="!VALIDATED_SERVICE"/>
    </bean>
    <bean id="associateServiceInM2MFlter" parent="genericFlter">
        <constructor-arg ref="associateServiceInM2MActivity"/>
        <property name="facts" value="VALIDATED_SERVICE,!ASSOCIATED_SERVICE,!STORE_SESSION_ASSOCIATED_SERVICE,!ASSOCIATION_ERROR"/>
    </bean>
    <bean id="storeSessionStepFlter" parent="genericFlter">
        <constructor-arg ref="storeSessionActivity"/>
        <property name="facts" value="VALIDATED_SERVICE,ASSOCIATED_SERVICE,!STORE_SESSION_ASSOCIATED_SERVICE,!ASSOCIATION_ERROR"/>
    </bean>
    <bean id="retryFlter" parent="genericFlter">
        <constructor-arg ref="RetryActivity"/>
        <property name="facts" value="VALIDATED_SERVICE,ASSOCIATED_SERVICE,STORE_SESSION_ASSOCIATED_SERVICE,RETRY"/>
    </bean>
    <bean id="processAsyncResponseFlter" parent="genericFlter">
        <constructor-arg ref="processAsyncResponseActivity"/>
        <property name="facts" value="VALIDATED_SERVICE,ASSOCIATED_SERVICE,STORE_SESSION_ASSOCIATED_SERVICE,!ASYNC_RESPONSE,!ASSOCIATION_ERROR"/>
    </bean>
    <bean id="processAsyncErrorResponseFlter" parent="genericFlter">
        <constructor-arg ref="processAsyncErrorResponseActivity"/>
        <property name="facts" value="!ASYNC_RESPONSE,ACTIVITY_ERROR,!ASYNC_ERROR_RESPONSE"/>
    </bean>

    <!--  PART 3 – POJO Activities -->
    <bean id="validateServiceDataActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.ValidateServiceDataActivity"/>
    <bean id="associateServiceInM2MActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.AssociateServiceInFM2SActivity"/>
    <bean id="storeSessionActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.StoreSessionActivity"/>
    <bean id="RetryActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.RetryActivity"/>
    <bean id="processAsyncResponseActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.ProcessAsyncResponseActivity"/>
    <bean id="processAsyncErrorResponseActivity" 
            class="com.alu.motive.smdm.mediation.process.orchestration.activity.ProcessAsyncErrorResponseActivity"/>
</beans>

Here is the trace of the application:

févr. 27, 2015 10:22:01 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
AVERTISSEMENT: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Cpmv215' did not find a matching property.
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server version:        Apache Tomcat/8.0.18
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server built:          Jan 23 2015 11:56:07 UTC
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server number:         8.0.18.0
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Name:               Windows 7
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Version:            6.1
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Architecture:          amd64
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Java Home:             C:\Program Files\Java\jre7
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Version:           1.7.0_75-b13
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Vendor:            Oracle Corporation
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: CATALINA_BASE:         C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: CATALINA_HOME:         C:\Tomcat\apache-tomcat-8.0.18
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dcatalina.base=C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dcatalina.home=C:\Tomcat\apache-tomcat-8.0.18
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dwtp.deploy=C:\PCRefresh\workspace-luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Djava.endorsed.dirs=C:\Tomcat\apache-tomcat-8.0.18\endorsed
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -javaagent:C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\spring-instrument-4.1.4.RELEASE.jar
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -XX:-UseSplitVerifier
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Command line argument: -Dfile.encoding=Cp1252
févr. 27, 2015 10:22:02 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFOS: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Oracle_universal\10_32;C:\Program Files\TortoiseSVN\bin;C:\ProgramFiles\nodejs\;C:\PCRefresh\oracle\instantclient\instantclient_11_2;C:\ProgramFiles\ApacheSoftwareFoundation\apache-maven-3.2.1\bin;C:\Program Files (x86)\CVSNT\;C:\Program Files\Java\jdk1.8.0_05\bin;C:\Users\claveri1\AppData\Roaming\npm;C:\ProgramFiles\nodejs;C:\PCRefresh\oracle\instantclient\instantclient_12_1;.
févr. 27, 2015 10:22:02 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["http-nio-8080"]
févr. 27, 2015 10:22:02 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFOS: Using a shared selector for servlet write/read
févr. 27, 2015 10:22:02 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["ajp-nio-8009"]
févr. 27, 2015 10:22:02 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFOS: Using a shared selector for servlet write/read
févr. 27, 2015 10:22:02 PM org.apache.catalina.startup.Catalina load
INFOS: Initialization processed in 886 ms
févr. 27, 2015 10:22:02 PM org.apache.catalina.core.StandardService startInternal
INFOS: Démarrage du service Catalina
févr. 27, 2015 10:22:02 PM org.apache.catalina.core.StandardEngine startInternal
INFOS: Starting Servlet Engine: Apache Tomcat/8.0.18
févr. 27, 2015 10:22:02 PM org.apache.jasper.servlet.TldScanner scanJars
INFOS: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
févr. 27, 2015 10:22:02 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFOS: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [182] milliseconds.
2015-02-27 22:22:16,310 [localhost-startStop-1] WARN  org.apache.axis2.transport.http.AxisAdminServlet - line:39 - Web application uses org.apache.axis2.transport.http.AxisAdminServlet; please update web.xml to use org.apache.axis2.webapp.AxisAdminServlet instead
2015-02-27 22:22:19,705 [localhost-startStop-1] WARN  org.apache.axis2.transport.http.AxisServlet - line:165 - No transportReceiver for org.apache.axis2.transport.http.AxisServletListener found. An instance for HTTP will be configured automatically. Please update your axis2.xml file!
févr. 27, 2015 10:22:19 PM org.apache.coyote.AbstractProtocol start
INFOS: Starting ProtocolHandler ["http-nio-8080"]
févr. 27, 2015 10:22:19 PM org.apache.coyote.AbstractProtocol start
INFOS: Starting ProtocolHandler ["ajp-nio-8009"]
févr. 27, 2015 10:22:19 PM org.apache.catalina.startup.Catalina start
INFOS: Server startup in 17470 ms
2015-02-27 22:22:34,987 [http-nio-8080-exec-3] INFO  com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:64 - associateService: beg - responseURI=http://localhost:8882/foo - endpointId=myEndPointId - sgwId=mySgwId - serviceID=myServiceId - serviceDeliveryID=mySDid
2015-02-27 22:22:34,988 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:71 - first check input parameters
2015-02-27 22:22:34,989 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:99 - All mandatory parameters found
2015-02-27 22:22:34,989 [http-nio-8080-exec-3] TRACE com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:100 - Instanciating service from input parameters
2015-02-27 22:22:34,991 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:107 - transaction id generated is: mPqRdhR5ASWc7bBB
2015-02-27 22:22:34,992 [http-nio-8080-exec-3] TRACE com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:113 - Service LCS is null with errorSubCode=null
2015-02-27 22:22:34,992 [http-nio-8080-exec-3] TRACE com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:114 - set synchronous answer to OK since there is no additional check
2015-02-27 22:22:34,993 [http-nio-8080-exec-3] DEBUG com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:129 - Launch the association orchestration
2015-02-27 22:22:35,001 [http-nio-8080-exec-3] INFO  com.alu.motive.if_dm_sm.IF_DM_SMSkeleton - line:176 - associateService: end (return the synchronous response)
2015-02-27 22:22:35,019 [Thread-8] DEBUG com.alu.motive.if_dm_sm.ThreadForAssociateService - line:22 - Begin of ThreadForAssociateService:run
2015-02-27 22:22:35,020 [Thread-8] DEBUG com.alu.motive.if_dm_sm.ThreadForAssociateService - line:27 - Load application configuration: application-config-associateService.xml
[TomcatInstrumentableClassLoader@4dee3a29] info AspectJ Weaver Version 1.8.5 built on Thursday Jan 29, 2015 at 01:03:58 GMT
[TomcatInstrumentableClassLoader@4dee3a29] info register classloader org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader@4dee3a29
[TomcatInstrumentableClassLoader@4dee3a29] info using configuration /C:/PCRefresh/workspace-luna/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Cpmv215/WEB-INF/classes/META-INF/aop.xml
[TomcatInstrumentableClassLoader@4dee3a29] info using configuration file:/C:/PCRefresh/workspace-luna/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Cpmv215/WEB-INF/lib/spring-aspects-4.1.4.RELEASE.jar!/META-INF/aop.xml
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect com.alu.motive.smdm.mediation.process.orchestration.process.TransitionGovernorAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.scheduling.aspectj.AnnotationAsyncExecutionAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.transaction.aspectj.AnnotationTransactionAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.cache.aspectj.AnnotationCacheAspect
[TomcatInstrumentableClassLoader@4dee3a29] info register aspect org.springframework.cache.aspectj.JCacheCacheAspect
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.TargetSource'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.TargetClassAware'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator$BeanFactoryAdvisorRetrievalHelperAdapter'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.aspectj.autoproxy.AspectJPrecedenceComparator'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.AdvisorAdapterRegistry'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.adapter.UnknownAdviceTypeException'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 
...
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.BeforeAdvice'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.AfterReturningAdvice'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.AfterAdvice'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.ThrowsAdvice'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.TrueMethodMatcher'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.support.MethodMatchers'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.ReflectiveMethodInvocation'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.ProxyMethodInvocation'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'org.springframework.aop.framework.InterceptorAndDynamicMethodMatcher'
2015-02-27 22:22:39,142 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:47 - >>>> Executing com.alu.motive.smdm.mediation.process.orchestration.activity.ValidateServiceDataActivity
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:51 - >>>> with Facts 
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ValidateServiceDataActivity - line:17 - Checking service data (nothing to check)
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:47 - >>>> Executing com.alu.motive.smdm.mediation.process.orchestration.activity.AssociateServiceInFM2SActivity
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.ActivityFilterInterceptor - line:51 - >>>> with Facts VALIDATED_SERVICE
2015-02-27 22:22:39,143 [Thread-8] DEBUG com.alu.motive.smdm.mediation.process.orchestration.activity.AssociateServiceInFM2SActivity - line:42 - AssociateServiceInFM2SActivity:process - BEG
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'com.sun.jersey.api.client.Client'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'com.sun.jersey.api.client.ClientHandler'
[TomcatInstrumentableClassLoader@4dee3a29] debug not weaving 'com.sun.jersey.api.client.filter.Filterable'

My issue:

My own classes (com.alu.motive.smdm.mediation.process.orchestration.activity.*) are never weaved. A advice will be apreciated to understand my issues.

Upvotes: 0

Views: 1382

Answers (3)

paul cla
paul cla

Reputation: 31

thanks

Here is my web.xml before the change.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://java.sun.com/xml/ns/javaee" 
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
            http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
            id="WebApp_ID" 
            version="2.5">
  <display-name>Cpmv215</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
    <welcome-file>/axis2-web/index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <display-name>Apache-Axis Servlet</display-name>
    <servlet-name>AxisServlet</servlet-name>
    <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/servlet/AxisServlet</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>*.jws</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
  <servlet>
    <display-name>Apache-Axis Admin Servlet Web Admin</display-name>
    <servlet-name>AxisAdminServlet</servlet-name>
    <servlet-class>org.apache.axis2.transport.http.AxisAdminServlet</servlet-class>
    <load-on-startup>100</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisAdminServlet</servlet-name>
    <url-pattern>/axis2-admin/*</url-pattern>
  </servlet-mapping>
</web-app>

Here is the the beginning of the web.xml after the change you have suggested:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://java.sun.com/xml/ns/javaee" 
        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
            http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
            id="WebApp_ID" 
            version="2.5"
        metadata-complete="true">

But, i have the same trace. Spring never tries to weave my own classes.

Upvotes: 0

paul cla
paul cla

Reputation: 31

I have resolved my issue. My jvm arguments were wrong. Note with the correction, the classes are loaded at the beginning and not only during the application context loading. Before, my jvm arg included:

-javaagent:C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\spring-instrument-4.1.4.RELEASE.jar

The correction was to set it like as follows:

-javaagent:"C:\PCRefresh\DATA\SNE\_CVS\SchneiderElectric\LWM2M\MediationLayer\Cpmv215\lib\aspectjweaver.jar"

Upvotes: 2

Steve McKay
Steve McKay

Reputation: 2223

Tomcat needs to scan the classpath to find classes with Servlet 3.0 annotations, which it does by loading all your classes. Because this happens before Spring configures AspectJ, your classes don't get woven. There are two ways to deal with this: either specify Servlet 2.5 in your web.xml, or add metadata-complete="true" to <web-app> in web.xml. If you're using Servlet 3.0 annotations (@Servlet, etc), that puts you in a pickle--AFAIK there's no way to combine LTW with Servlet 3.0 annotations on Tomcat.

Upvotes: 0

Related Questions