Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: (RESOLVED?) RE: [aspectj-users] Important aspects of JDK1.4 weaving

Hello again Mr. Bodkin! 
 
I wish I had the success with Alex's method that you have.  I've been trying it in several revisions of Weblogic 8.1, on both the examples and the medrec servers and apps.  After several trials and errors, as I learned the ins-and-outs of the scheme, I was able to achieve weaving.  However, even in my partial success, the exceptions thrown are truly magnificent in their breadth.  My first thought was that it had to do with some sort of recursive classloading problem of the sort which the ClassPreProcessorAdapter is trying to avoid by screening the class names.  However, closer examination ruled that out pretty quickly.
 
In general, this particular potential solution to JDK1.4 weaving is not ideal, since you must re-Hook.Plug your adaptor against the tools.jar library for the JDK being used at that particular moment, by the particular WebLogic SP/revision. That creates creative installation issues.  I have found good documentation on WebLogic classloaders however, so I will try that solution next, though if the Hook.Plug exception I got just so happens to ring a bell with you, I'd appreciate any comments.   I poked through the AspectJ source a bit (through the web interface) to try and figure out the exceptions.   It appears that the cause is that the following variable, whose declaration from WeavingAdaptor.java is shown here, is null at the time the method in question is invoked:
 
protected BcelWorld bcelWorld;
 
This fact, in turn suggests the method init( was never called, but that method call is in a constructor, so its being missed seems unlikely.  But here is the exception anyway, for your examination:
 
while trying to load (not weave) "weblogic/utils/NestedException"

java.lang.NullPointerException
 at org.aspectj.weaver.tools.WeavingAdaptor$WeavingClassFileProvider.<init>(WeavingAdaptor.java:472)
 at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBytes(WeavingAdaptor.java:276)
 at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:210)
 at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:65)
 at org.aspectj.ext.ltw13.ClassPreProcessorAdapter.preProcess(ClassPreProcessorAdapter.java:30)
 at org.codehaus.aspectwerkz.hook.impl.ClassPreProcessorHelper.defineClass0Pre(ClassPreProcessorHelper.java:107)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
 at java.lang.ClassLoader.defineClass0(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
 at java.lang.Class.getDeclaredConstructors0(Native Method)
 at java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
 at java.lang.Class.getConstructor0(Class.java:1930)
 at java.lang.Class.newInstance0(Class.java:278)
 at java.lang.Class.newInstance(Class.java:261)
 at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:95)
 at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:174)
 at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:87)
 at org.aspectj.weaver.loadtime.definition.DocumentParser.getXMLReader(DocumentParser.java:129)
 at org.aspectj.weaver.loadtime.definition.DocumentParser.parse(DocumentParser.java:85)
 at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(ClassLoaderWeavingAdaptor.java:162)
 at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:102)
 at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(Aj.java:130)
 at org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(Aj.java:135)
 at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:101)
 at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:61)
 at com.dbi.bwd.bwagent.LTW13.preProcess(LTW13.java:30)
 at org.codehaus.aspectwerkz.hook.impl.ClassPreProcessorHelper.defineClass0Pre(ClassPreProcessorHelper.java:107)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

 

Back to the top