Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
None
-
None
Description
Special measures need to be taken for load-time-weaving with aspects, but using them without load-time weaving works normally OOB. However, if this kind of Spring configuration is used:
<!-- Test to get a data source -->
<jee:jndi-lookup id="dataSource" jndi-name="jboss/datasources/ExampleDS"/>
<!-- AOP part -->
<bean id="methodTraceAspect" class="fi.eis.applications.jboss.poc.gemini.spring.aop.support.api.MyMethodTraceAspect"/>
<aop:aspectj-autoproxy />
<!-- end AOP -->
<bean class="fi.eis.applications.controllers.HomeController">
<constructor-arg ref="dataSource" />
</bean>
JBoss tries to use methodTraceAspect also on the data source. Data source is loaded by ModuleClassLoader that in has only visibility to org.jboss.jca.adapters* classes (confirmed with a debugger), so it cannot find the aspect class anymore, making aspect-j throw org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning can't determine implemented interfaces of missing type
fi.eis.applications.jboss.poc.gemini.spring.aop.support.api.MyMethodTraceAspect [Xlint:cantFindType].
This has large problems in bigger applications, where general AOP pointcuts are used - no jboss-module stuff can be used as beans, anywhere. I'm aware of no workaround for this.