users@glassfish.java.net

Re: newbie classloader problems

From: <glassfish_at_javadesktop.org>
Date: Sun, 18 Mar 2007 08:27:31 PST

I took a very brief look at the output you posted - thanks for making it available.

Some background: When GlassFish prepares a class loader for use by an app, is uses its own EJBClassLoader which has some useful behavior that the JDK's URLClassLoader does not have. In particular, it has a done() method which the app server invokes to indicate that it does not intend to use that class loader any more. The EJBClassLoader can then clean up a number of things, such as open JARs, that it needed while it was being used.

GlassFish invokes this done() method when the app is undeployed, disabled, or when the server is shutting down, and done() records the current stack trace internally so it knows what code invoked done().

Once GF has invoked a classloader's done() method the class loader should not be used any more to resolve classes or resources. Each time it is asked to do so the class loader logs the warning you are seeing, reporting both the stack trace from the done() invocation as well as the current invocation that has asked it to load a class, get a resource, etc. The idea is that somehow the class loader is being used after GF has declared it is done with it and all this output is to help identify why.

You see one long display including two stack traces for each attempt to use the class loader after its done() method was called.

(A separate point is that the very first messages in the output you posted show that the EJBClassLoader has detected that some code opened streams using the class loader but has not closed them explicitly and that it - the class loader itself - is now closing those streams itself, probably as a result of its done() method being invoked. If you look at the stack traces from those displays it looks like the seam framework opened the streams but did not close them when it was done with them.)

As for the later messages, this may be due to some code in the GlassFish web container that I think has been changed in GlassFish V2 (I noticed from the log messages that you are using Sun Java System Application Server 9.0 which corresponds to GlassFish V1.) The web container guys might know more surely if this is the case.

Despite these messages does everything work the way you expect it to? The EJBClassLoader, once its done() method has been invoked, should log the warnings but then not load the class or find the resource, letting other loaders in the chain handle it instead.

- Tim
[Message sent by forum member 'tjquinn' (tjquinn)]

http://forums.java.net/jive/thread.jspa?messageID=208626