[
https://issues.jboss.org/browse/AS7-6305?page=com.atlassian.jira.plugin.s...
]
jarkko rantavuori edited comment on AS7-6305 at 1/16/13 3:24 AM:
-----------------------------------------------------------------
Ok, I found out what I needed to do - to add "Dependencies:
org.jboss.ironjacamar.jdbcadapters" in the manifest. Then it works. I don't know
from where I should've got that information - found the module name via debugger
inspection of the classloader used.
was (Author: jrantav):
Ok, I found out what I needed to do - to add "Dependencies:
org.jboss.ironjacamar.jdbcadapters" in the manifest. Then it works. I don't know
from where I would've got that information.
ModuleClassLoader breaks Aspect-J non-load-time-weaving aspects
----------------------------------------------------------------
Key: AS7-6305
URL:
https://issues.jboss.org/browse/AS7-6305
Project: Application Server 7
Issue Type: Bug
Components: Class Loading, Web
Affects Versions: 7.1.1.Final, 7.2.0.Alpha1
Environment: Windows 7
Reporter: jarkko rantavuori
Assignee: David Lloyd
Attachments: MyMethodTrace.java, MyMethodTraceAspect.java,
spring-app-aop-datasource-1.0.0-BUILD-SNAPSHOT.war, spring-mvc-aop-datasource-app.zip
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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira