users@glassfish.java.net

Re: EJB Client runs in Netbeans, but not outside

From: <glassfish_at_javadesktop.org>
Date: Wed, 19 Mar 2008 08:18:06 PST

Hi,
I'm facing a similar problem, same symptom, but I'm trying to access a JDBC pool defined in Glassfish from outside (from within an ANT build script)

I could narrow down the problem a bit:
my ANTClassLoader contained all libraries from glassfish/lib but still, I got that exception when calling new InitialContext().

I've then noticed, that the Thread.currentThread().getContextClassLoader() was not set to my ANTClassLoader. If I changed that before calling new InitialContext() I got further to the next ClassNotFoundError, which led to inclusion of also glassfish/imq/lib into my classpath.

Now it almost works, it just complains about a class from the mySQL jdbc driver which was not found ...

Christian
[Message sent by forum member 'christianr' (christianr)]

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