Hi dr_pompeii,
My xsd was using version 2.0 for AOP, I have now changed this to 2.5, as per your suggestion, but I still cannot get it to work. I have not changed the code "ProfilingAspect" and "SystemArchitecture".
This is the complete spring configuration I am using:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<!-- Activates annotation-based bean configuration -->
<context:annotation-config />
<!-- Scans for application @Components to deploy -->
<context:component-scan base-package="com.someCompany" />
<context:load-time-weaver/>
<!-- This configuration does not work -->
<aop:aspectj-autoproxy/>
<bean id="profiler" class="com.someCompany.someApp.logger.ProfilingAspect" />
<!-- This commented out configuration works when not un-commented
<aop:config>
<aop:aspect ref="profiler">
<aop:pointcut id="profileServiceMethods" expression="com.someCompany.someApp.SystemArchitecture.businessService()"/>
<aop:around pointcut-ref="profileServiceMethods" method="profile"/>
</aop:aspect>
</aop:config>
-->
</beans>
This is my aop.xml:
Code:
<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
<weaver options="-verbose -showWeaveInfo -XmessageHandlerClass:org.springframework.aop.aspectj.AspectJWeaverMessageHandler">
<!-- only weave classes in our application-specific packages -->
<include within="com.someCompany.someApp.*" />
</weaver>
<aspects>
<aspect name="com.someCompany.someApp.logger.ProfilingAspect" />
</aspects>
</aspectj>
This is a snippet of the working system out:
Code:
1422 [main] INFO weaving.DefaultContextLoadTimeWeaver - Found Spring's JVM agent for instrumentation
1719 [main] INFO AspectJ Weaver - [AspectJ] AspectJ Weaver Version 1.6.1 built on Thursday Jul 3, 2008 at 18:35:41 GMT
1719 [main] INFO AspectJ Weaver - [AspectJ] register classloader org.apache.catalina.loader.WebappClassLoader@b0ce8f
1719 [main] INFO AspectJ Weaver - [AspectJ] using configuration /C:/eclipse-jee-ganymede-3-4/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/SomeApp/WEB-INF/classes/META-INF/aop.xml
1766 [main] INFO AspectJ Weaver - [AspectJ] register aspect com.someCompany.someApp.logger.ProfilingAspect
2516 [main] INFO support.XmlWebApplicationContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2579 [main] INFO support.XmlWebApplicationContext - Bean 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2579 [main] INFO support.XmlWebApplicationContext - Bean '(inner bean)#2' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
This is a snippet of the not working system out:
Code:
1375 [main] INFO weaving.DefaultContextLoadTimeWeaver - Found Spring's JVM agent for instrumentation
1672 [main] INFO AspectJ Weaver - [AspectJ] AspectJ Weaver Version 1.6.1 built on Thursday Jul 3, 2008 at 18:35:41 GMT
1672 [main] INFO AspectJ Weaver - [AspectJ] register classloader org.apache.catalina.loader.WebappClassLoader@b0ce8f
1672 [main] INFO AspectJ Weaver - [AspectJ] using configuration /C:/eclipse-jee-ganymede-3-4/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/SomeApp/WEB-INF/classes/META-INF/aop.xml
1719 [main] INFO AspectJ Weaver - [AspectJ] register aspect com.someCompany.someApp.logger.ProfilingAspect
2859 [main] INFO support.XmlWebApplicationContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
I notice the working version prints out this statement after weaving:
Code:
2579 [main] INFO support.XmlWebApplicationContext - Bean 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Thanks again.