users@glassfish.java.net

GlassFish 3.1 Classloader Question

From: <forums_at_java.net>
Date: Mon, 6 Jun 2011 10:34:52 -0500 (CDT)

Hi all,

I'm in the process of upgrading an old project from Glassfish 2.1 to 3.1. I
ran into a somewhat puzzling problem that I wondered if anyone could shed
some light on.

Some details:

  * I'm packaging my app as a "Enterprise Application Project" 
  * in NetBeans (7.0) and
  * deploying the EAR to GlassFish 3.1 (build 43).
  * My app consists of:
  * * an EJB jar
     * a WAR
        * With several jar libraries



One of the jar libraries does some initialization using reflection and calls
"class.forName(...)" to try to load a class and set up some services.

When this class is inside the WAR itself (where it was originally), I was
get "NoClassDefFound" (or ClassNotFoundException, I forget which).

When I moved the class out into a separate jar library (alongside the jar
that tries to load it) it works fine.

What's going on here? Is this by design?

Thanks for any light you can shed.

--Chris


--
[Message sent by forum member 'christopherrued']
View Post: http://forums.java.net/node/809783