The problem doesn't seem to be with Aspect-J as such, as a quick demo application using Aspect-J the same mechanism works just fine. However, a more complex one with aspects in one jar and configuration in another doesn't seem to find any aspect classes on AS7, but works fine on other app server.
1 of 1 people found this helpful
Ok, I think I've found the problem relate to ModuleClassLoader and jboss modules. On a regular case it works fine. However, having this kind of spring configuration:
<!-- Enables the Spring MVC @Controller programming model --> <mvc:annotation-driven /> <!-- 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>
will, since dataSource comes from JBoss internal modules, try to attach AOP trace to that data source, too. This will fail with IllegalArgumentException, coming from:
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]
since dataSource is loaded by ModuleClassLoader, and that classloader only has visibility to classes org.jboss.jca.adapters.* classes, as can be seen from the debugger.
in the manifest.