[jboss-user] [Spring Integration] New message: "Using JBoss(4.2.0) with Spring and AspectJ"

Bala krishnan do-not-reply at jboss.com
Fri Feb 19 05:47:55 EST 2010


User development,

A new message was posted in the thread "Using JBoss(4.2.0) with Spring and AspectJ":

http://community.jboss.org/message/527222#527222

Author  : Bala krishnan
Profile : http://community.jboss.org/people/adreamer

Message:
--------------------------------------------------------------
I have an application in which I'm trying to use AspectJ with Spring and deploy it in JBoss 4.2.0.
 
AspectJ is integrated with spring and is loaded via
 
<context:load-time-weaver />
 
in spring xml file. When I run the application in standalone, it works fine -- aspects are getting called.
 
However, when I deploy the application (as a war) in JBoss, aspects are not called. I think that the classes are also not weaved -- I've have enabled debug in aop.xml,
 
<aspect> 
    <weaver options="-debug -verbose -showWeaveInfo">
    ....
    </weaver>
    ....
</aspect>
 
and logs(weaving related logs) are not printed when I run the application as war. However, I do get message that aop.xml files are loaded and aspects areregistered.
 
What should I do to make aspects called in this environment? I tried disabling tomcat specific classloader (setting UseJBossWebLoader and Java2ClassLoadingCompliance to "true" in jboss-service.xml of tomcat, but that also didn't work. I have also given "-javaagent" to jboss startup.
 
When I searched, one option given was to use application specific "context.xml" for tomcat and copy spring-tomcat-weaver.jar to tomcat classpath. However, I got a exception, saying logger class is available in two class hierarchies, when I tried this. Is this(having a context.xml) the correct way to solve the issue? How the whole thing will work if I have an EAR and a WAR inside that EAR (assuming that I want to weave classes inside and outside war)?
 

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/527222#527222




More information about the jboss-user mailing list