Community
Participate
Working Groups
I get the following NPE when Eclipse starts up. It happens fairly rarely, maybe one in ten starts. java.lang.NullPointerException at org.aspectj.weaver.bcel.LazyMethodGen.<init>(LazyMethodGen.java:205) at org.aspectj.weaver.bcel.LazyClassGen.<init>(LazyClassGen.java:306) at org.aspectj.weaver.bcel.BcelObjectType.getLazyClassGen(BcelObjectType.java:558) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1690) at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1641) at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1404) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1190) at org.aspectj.weaver.tools.WeavingAdaptor.getWovenBytes(WeavingAdaptor.java:469) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:320) at org.eclipse.equinox.weaving.aspectj.loadtime.OSGiWeavingAdaptor.weaveClass(OSGiWeavingAdaptor.java:121) at org.eclipse.equinox.weaving.aspectj.AspectJWeavingService.preProcess(AspectJWeavingService.java:151) at org.eclipse.equinox.weaving.adaptors.WeavingAdaptor.weaveClass(Unknown Source) at org.eclipse.equinox.weaving.hooks.WeavingHook.processClass(Unknown Source) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:594) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:562) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:486) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:459) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4887) at org.eclipse.jdt.internal.launching.LaunchingPlugin$VMChanges.doit(LaunchingPlugin.java:270) at org.eclipse.jdt.internal.launching.LaunchingPlugin$JREUpdateJob.run(LaunchingPlugin.java:366) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Moving to AspectJ for comment.
Can you tell me what versions of the components you are using? equinox/JDT weaving and AspectJ? We recently (within the last 6months) did have to make some important fixes in that area due to a change in locking strategies below us. Without the change sometimes two threads got into the weaver and strange exceptions would come out.
I am not sure if this is what you need, but here are the weaving-related plugin versions: org.aspectj.weaver/1.6.12.20110613132200 org.eclipse.equinox.weaving.hook/1.0.100.v20110502 org.eclipse.equinox.weaving.aspectj/1.0.1.v20110502
Those versions do look quite old. The most recent discussion I think we had around equinox/jdt weaving versions was in bug 338033. If you have the weaving stuff because you have AJDT installed, I'd recommend updating AJDT to a recent version. (Similarly if you have it because you have the scala tools installed, I'd recommend updating those). This kind of NPE can happen if two threads get lose in the same weaver, one is half way through initializing something whilst the other thinks it is initialized and is using it.