[jboss-user] [JBoss AOP] - Aspect problem when deployed in 2 war files with PER_VM scope.

sri varsh do-not-reply at jboss.com
Mon Apr 12 05:14:50 EDT 2010


sri varsh [http://community.jboss.org/people/rsrivarsh] created the discussion

"Aspect problem when deployed in 2 war files with PER_VM scope."

To view the discussion, visit: http://community.jboss.org/message/536830#536830

--------------------------------------------------------------
Hi,

I am using jboss aop for creating trace aspects for logging method entry and exit..
We have 2 war files deployed in the same jboss server.
Both the war files have their own TraceAspect class (in fact it is a single TraceAspect class which is copied into both war files).
We use loadtime weaving and the jboss-aop.xml for TraceAspect has scope as PER_VM.

Scenario
--------
When we give the first request on war1 endpoint the aop trace works fine.
and when we give request on war2 endpoint we get the following.

java.lang.IllegalArgumentException: Can not set TraceAspect field org.jboss.aop.advice.TraceAspect211.aspectField to TraceAspect
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
        at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
        at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
        at java.lang.reflect.Field.set(Field.java:657)
        at org.jboss.aop.advice.PerVmAdvice.generateInterceptor(PerVmAdvice.java:134)
        at org.jboss.aop.advice.PerVmAdvice.generateOptimized(PerVmAdvice.java:56)
        at org.jboss.aop.advice.AdviceFactory.create(AdviceFactory.java:68)
        at org.jboss.aop.Advisor.createInterceptorChain(Advisor.java:618)
        at org.jboss.aop.Advisor.pointcutResolved(Advisor.java:888)
        at org.jboss.aop.Advisor.resolveMethodPointcut(Advisor.java:650)
        at org.jboss.aop.ClassAdvisor.createInterceptorChains(ClassAdvisor.java:607)
        at org.jboss.aop.ClassAdvisor.access$300(ClassAdvisor.java:82)
        at org.jboss.aop.ClassAdvisor$1.run(ClassAdvisor.java:299)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.aop.ClassAdvisor.attachClass(ClassAdvisor.java:271)


When we give the first request on war2 endpoint the aop trace works fine.
and when we give request on war1 endpoint we get similar error as metioned above.

We tried changing the scope of the aspect to PER_CLASS still we get the same error
(And the PerClassAdvice calls PerVmAdvice in the stacktrace).

Jboss as - 4.2.3 GA
jboss-aop-1.5.6.GA ( which is included in the 4.2.3 server)

Kindly requesting any help on this issue.

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

Reply to this message by going to Community
[http://community.jboss.org/message/536830#536830]

Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2027]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100412/eaf5254a/attachment.html 


More information about the jboss-user mailing list