Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] AspectJ/spring aop not weaving object for package-level, project-level unit tests

Okay, 19 hours later, I only have one problem left.

I run my test cases in isolation - no problem... the weaving works as my tests pass and I can verify it from the log output as well. But if I run my tests packages like domain.* or the entire project using maven or inside idea - bam! - the weaving doesn't work.

Basically when it's working, the log output looks like this:
Code:
INFO [AspectJ Weaver] - [AspectJ] AspectJ Weaver Version 1.6.4 built on Monday Apr 20, 2009 at 16:48:12 GMT
INFO [AspectJ Weaver] - [AspectJ] register classloader sun.misc.Launcher$AppClassLoader@130c19b
INFO [AspectJ Weaver] - [AspectJ] using configuration /C:/IdeaProjects/jobprep/target/classes/META-INF/aop.xml
INFO [AspectJ Weaver] - [AspectJ] using configuration file:/C:/Documents%20and%20Settings/Bob%20Milton/.m2/repository/org/springframework/spring-aspects/2.5.6.SEC01/spring-aspects-2.5.6.SEC01.jar!/META-INF/aop.xml
INFO [AspectJ Weaver] - [AspectJ] register aspect org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
INFO [AspectJ Weaver] - [AspectJ] register aspect org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
INFO [AspectJ Weaver] - [AspectJ] register aspect org.springframework.transaction.aspectj.AnnotationTransactionAspect
WARN [AspectJ Weaver] - [AspectJ] javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
INFO [AspectJ Weaver] - [AspectJ] Extending interface set for type 'jobprep.domain.openended.OpenEndedQuestion' (OpenEndedQuestion.java) to include 'org.springframework.beans.factory.aspectj.ConfigurableObject' (AnnotationBeanConfigurerAspect.aj)
INFO [AspectJ Weaver] - [AspectJ] Extending interface set for type 'jobprep.domain.openended.OpenEndedQuestion' (OpenEndedQuestion.java) to include 'org.springframework.beans.factory.aspectj.AbstractInterfaceDrivenDependencyInjectionAspect$ConfigurableDeserializationSupport' (AnnotationBeanConfigurerAspect.aj)
INFO [AspectJ Weaver] - [AspectJ] Type 'jobprep.domain.openended.OpenEndedQuestion' (OpenEndedQuestion.java) has intertyped method from 'org.springframework.beans.factory.aspectj.AbstractInterfaceDrivenDependencyInjectionAspect' (AbstractInterfaceDrivenDependencyInjectionAspect.aj:'java.lang.Object org.springframework.beans.factory.aspectj.AbstractInterfaceDrivenDependencyInjectionAspect$ConfigurableDeserializationSupport.readResolve()')
INFO [AspectJ Weaver] - [AspectJ] Join point 'initialization(void org.springframework.beans.factory.aspectj.ConfigurableObject.<init>())' in Type 'jobprep.domain.openended.OpenEndedQuestion' (OpenEndedQuestion.java:36) advised by before advice from 'org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect' (AbstractDependencyInjectionAspect.aj:78) [with runtime test]
INFO [AspectJ Weaver] - [AspectJ] Join point 'initialization(void org.springframework.beans.factory.aspectj.ConfigurableObject.<init>())' in Type 'jobprep.domain.openended.OpenEndedQuestion' (OpenEndedQuestion.java:36) advised by afterReturning advice from 'org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect' (AbstractDependencyInjectionAspect.aj:87) [with runtime test]
INFO [AspectJ Weaver] - [AspectJ] Join point 'initialization(void org.springframework.beans.factory.aspectj.ConfigurableObject.<init>())' in Type 'jobprep.domain.openended.OpenEndedQuestion' (OpenEndedQuestion.java:41) advised by before advice from 'org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect' (AbstractDependencyInjectionAspect.aj:78) [with runtime test]
INFO [AspectJ Weaver] - [AspectJ] Join point 'initialization(void org.springframework.beans.factory.aspectj.ConfigurableObject.<init>())' in Type 'jobprep.domain.openended.OpenEndedQuestion' (OpenEndedQuestion.java:41) advised by afterReturning advice from 'org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect' (AbstractDependencyInjectionAspect.aj:87) [with runtime test]
INFO [AspectJ Weaver] - [AspectJ] Join point 'initialization(void jobprep.domain.openended.OpenEndedQuestion.<init>())' in Type 'jobprep.domain.openended.OpenEndedQuestion' (OpenEndedQuestion.java:36) advised by afterReturning advice from 'org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect' (AbstractDependencyInjectionAspect.aj:87) [with runtime test]
INFO [AspectJ Weaver] - [AspectJ] Join point 'initialization(void jobprep.domain.openended.OpenEndedQuestion.<init>(java.lang.String))' in Type 'jobprep.domain.openended.OpenEndedQuestion' (OpenEndedQuestion.java:41) advised by afterReturning advice from 'org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect' (AbstractDependencyInjectionAspect.aj:87) [with runtime test]
But when it's not working, the log output is shorter:
Code:
INFO [AspectJ Weaver] - [AspectJ] AspectJ Weaver Version 1.6.4 built on Monday Apr 20, 2009 at 16:48:12 GMT
INFO [AspectJ Weaver] - [AspectJ] register classloader sun.misc.Launcher$AppClassLoader@130c19b
INFO [AspectJ Weaver] - [AspectJ] using configuration /C:/IdeaProjects/jobprep/target/classes/META-INF/aop.xml
INFO [AspectJ Weaver] - [AspectJ] using configuration file:/C:/Documents%20and%20Settings/Bob%20Milton/.m2/repository/org/springframework/spring-aspects/2.5.6.SEC01/spring-aspects-2.5.6.SEC01.jar!/META-INF/aop.xml
INFO [AspectJ Weaver] - [AspectJ] register aspect org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
INFO [AspectJ Weaver] - [AspectJ] register aspect org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
INFO [AspectJ Weaver] - [AspectJ] register aspect org.springframework.transaction.aspectj.AnnotationTransactionAspect
WARN [AspectJ Weaver] - [AspectJ] javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
I'm using the EXACT same jvm settings and everything. The only difference is a class to package change. The bigger the scope, the more likely it doesn't work.

Basically the aspectj weaver is just skipping over my "jobprep.domain" directory, minus a few of its classes. I dunno what the classloader is looking at... but something is very, very wrong. In the first case... it finds all the jobprep.domain.* classes. In the second case, it finds only a few... and obviously the one I need weaved by aspectj is not seen by the weaver at all... which is strange, because obviously they are used in the tests.

What the heck is going on?

My aop.xml is this:
Code:
<aspectj>
<weaver options="-showWeaveInfo -XmessageHandlerClass:org.springframework.aop.aspectj.AspectJWeaverMessageHandler">
<include within="jobprep.domain.openended.OpenEndedQuestion"/>
</weaver>
</aspectj>
Although I've tried to add the aspects manually thinking that might help.

I'm very tired and very frustrated now. Any help would be appreciated :/ Thank you very much.

Back to the top