Hi Andy -
Thanks for the quick reply. We are doing load time weaving. How do I specify this option when using spring for the aop configuration? I tried adding an aop.xml file to the ear's META-INF/ directory, but it doesn't seem to have an
The bug we're encountering is probably more on our side than in aspectj. Our custom Adaptor Factory Bean returns a Proxy, which fails to be loaded by ReflectionBasedReferenceTypeDelegateFactory (line 38) which results in the creation of a MissingResolvedTypeWithKnownSignature type. During optimized matching, it looks like it tries to get some information from the object (in KindedPointcut, line 126), but since it's a "MissingResolvedTypeWithKnownSignature", this results in an exception thrown
Post-processing of the FactoryBean's object failed; nested exception is org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine modifiers of missing type $Proxy380
The specific problem seems to be that our custom adaptor factory bean loads the proxy in a different class loader than the World is initialized with. The deployment consists of an ear with multiple wars, and the first war ends up initializing spring/aspectj, so its classloader is the one used by the World, but other wars end up using a different classloader for the proxy object. Once the postprocessing is allowed to occur in the first war and the object is cached, the problem goes away. In aspectj 1.5.3, this wasn't a problem, but I can't find source code to step through what it's doing differently. I assumed turning off the optimized matching in 1.6.9 would help, since that's
where the above exception is coming from (plus everything works after it's correctly loaded/post processed by the first war). That would be a quick fix while we tried to untangle the classloader problems.
On 4 January 2011 21:41, Andy Clement <andrew.clement@xxxxxxxxx
> Hi Anthony,
> Do you mean the optimized matching that became default in AspectJ
> 1.6.7 onwards? (Discussed here:> http://andrewclement.blogspot.com/2009/11/aspectj-how-much-faster-is-aspectj-167.html
> ). Ideally I'd like to fix any bugs so it isn't causing you an issue
> under Spring - do you want to raise an AspectJ bug for the
> There is a configuration option for the weaver that turns it
> But I'm not sure where you would set that, it depends on your spring
> configuration. I would normally set it either on the command line (if
> compile time weaving), or in an aop.xml file (if loadtime weaving).
> On 4 January 2011 18:40, Anthony Tang <aant00@xxxxxxxxx
> > Hi -
> > I am having a problem with optimized matching specific to a custom Adaptor
> > Factor Bean I have in Spring.? While trying to figure that out, it looks
> > like I can get around it by turning off "optimized matching", but I can't
> > find documentation on how to specify these configurations.
> > How do I specify an option to the JVM so that aspectj
turns off optimized
> > matching?? I am running a web
application deployed as an EAR in JBoss.
> > Thanks!
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users