From: aclement Date: Thu, 10 Dec 2009 22:25:35 +0000 (+0000) Subject: 231945: guard on null and tell them what to do about it X-Git-Tag: V1_6_7~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b3f0ddfcb6743dd0b78309fcc9fcea4036aad51d;p=aspectj.git 231945: guard on null and tell them what to do about it --- diff --git a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java index f9060140d..80c523024 100644 --- a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -275,6 +275,12 @@ public class WeavingAdaptor implements IMessageContext { * @exception IOException weave failed */ public byte[] weaveClass(String name, byte[] bytes, boolean mustWeave) throws IOException { + if (trace==null) { + // Pr231945: we are likely to be under tomcat and ENABLE_CLEAR_REFERENCES hasn't been set + System.err.println("AspectJ Weaver cannot continue, static state has been cleared. Are you under Tomcat? In order to weave '"+name+ + "' during shutdown, 'org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false' must be set (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=231945)."); + return bytes; + } if (weaverRunning.get()) { // System.out.println("AJC: avoiding re-entrant call to transform " + name); return bytes;