Hello AspectJ ! I am currently porting some aspects from made for JBoss (4.2.3) on WebSphere 7. In the last day I found some article and post on AspectJ/WebSphere issues.
I think the big part is done since the aspect are deployed and registered in classloaders. One aspect works perfectly, however, for the other one, the pointcut does not seems to be matched anywhere. Here is a log fragment : [12/09/11 13:20:56:381 CEST] 00000012 SystemErr R [ExtClassLoader@43c043c0] info register aspect com.xyz.aspects.isSerializableAspect.IsSerializableSessionAspect [12/09/11 13:20:56:584 CEST] 00000012 SystemErr R [ExtClassLoader@43c043c0] info register aspect com.xyz.aspects.log4jStackTraceAspect.Log4jStackTraceAspect ... [12/09/11 13:21:30:501 CEST] 00000014 SystemErr R [ExtClassLoader@43c043c0] weaveinfo Join point 'method-execution(void org.apache.log4j.Category.warn(java.lang.Object))' in Type 'org.apache.log4j.Category' (Category.java:1004) advised by before advice from 'com.xyz.aspects.log4jStackTraceAspect.Log4jStackTraceAspect' (Log4jStackTraceAspect.aj:39) The IsSerializableSessionAspect's pointcut expression is execution(public * javax.servlet.http.HttpSession+.setAttribute(..)) && args(key,value) In fact I am inspecting the HttpSession and verify that all added attribute can be serialized (very similar to http://www.beernut.ca/jim/archives/005157.html). At the moment the JAR has been placed in %WAS%/lib/is-serializable-session-1.0-SNAPSHOT.jar!/META-INF/aop.xml. aop.xml contains the following definition <aspectj> <weaver options="-Xset:weaveJavaxPackages=true -showWeaveInfo -verbose"> <include within="*"/> </weaver> <aspects> <aspect name="com.xyz.aspects.log4jStackTraceAspect.Log4jStackTraceAspect" /> </aspects> </aspectj> On JBoss the aspect is woven correctly here is the corresponding log entries : 2011-09-12 12:10:46,549 ERROR @ [STDERR] [UnifiedClassLoader3@11d329d] weaveinfo Join point 'method-execution(void org.jboss.web.tomcat.service.session.ClusteredSession.setAttribute(java.lang.String, java.lang.Object))' in Type 'org.jboss.web.tomcat.service.session.ClusteredSession' (ClusteredSession.java:538) advised by before advice from 'com.xyz.aspects.isSerializableAspect.IsSerializableSessionAspect' (IsSerializableSessionAspect.aj:36) 2011-09-12 12:10:46,565 ERROR @ [STDERR] [UnifiedClassLoader3@11d329d] weaveinfo Join point 'method-execution(void org.apache.catalina.session.StandardSession.setAttribute(java.lang.String, java.lang.Object))' in Type 'org.apache.catalina.session.StandardSession' (StandardSession.java:1254) advised by before advice from 'com.xyz.aspects.isSerializableAspect.IsSerializableSessionAspect' (IsSerializableSessionAspect.aj:36) 2011-09-12 12:10:46,581 ERROR @ [STDERR] [UnifiedClassLoader3@11d329d] weaveinfo Join point 'method-execution(void org.apache.catalina.session.StandardSession.setAttribute(java.lang.String, java.lang.Object, boolean))' in Type 'org.apache.catalina.session.StandardSession' (StandardSession.java:1277) advised by before advice from 'com.xyz.aspects.isSerializableAspect.IsSerializableSessionAspect' (IsSerializableSessionAspect.aj:36) I was wondering is anyone already tried this on WebSphere or if one of you had an idea concerning this issue. Maybe I should enable a specific weaver option ? Or add the jar to the classpath using another method ? Thanks for your help, Olivier Edit: I am wondering is this is not related to the used classloader. >From what I see in the logs, the aspect is registered on 2 class loaders. But the HttpSession interface comes from the J2EE API library which should be in the Bootstrap or Classpath Classloader. [12/09/11 15:07:02:917 CEST] 00000014 SystemErr R [CompoundClassLoader@23ee23ee] info register aspect com.bsb.rd.aspects.isSerializableAspect.IsSerializableSessionAspect ... [12/09/11 15:07:10:031 CEST] 00000014 SystemErr R [ExtClassLoader@47614761] info register aspect com.bsb.rd.aspects.isSerializableAspect.IsSerializableSessionAspect ... I tried to change Permission in the %was%/java/jre/java.policy file without success -- View this message in context: http://aspectj.2085585.n4.nabble.com/LTW-on-WebSphere-7-tp3809337p3809337.html Sent from the AspectJ - users mailing list archive at Nabble.com. _______________________________________________ aspectj-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/aspectj-users
