How do you load your class dynamically?  Are you loading your class from the
application's class loader or the system classloader?

Try to load the class from the application's class loader by the following
method

Thread.currentThread().getContextClassLoader().loadClass("");

the above method tries to find the class from the current context which will
give you the application's classloader.

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Sunday, September 23, 2001 7:36 PM
Subject: Classpath Structure Problem ?


> SYMPTOMS
> -------- When I invoke my webapp, the first request to the server causes
> the front servlet to throw a class-def-not-found exception for the app's
> session class, which it loads dynamically. The class in question is in
> fact present in the app's war file, in the web-inf classes directory.
>
> To nail the problem down, I printed the jvm's class path, immediately
> before the attempt to load the session class. With newline chars
> inserted after each ';' for legibility, the classpath looks like this:
>
> classpath: orion.jar;
> C:\j2ee\home\ejb.jar;
> C:\j2ee\home\activation.jar;
> C:\j2ee\home\jdbc.jar;
> C:\j2ee\home\jndi.jar;
> C:\j2ee\home\jta.jar;
> C:\j2ee\home\mail.jar;
> C:\j2ee\home\xerces.jar;
> C:\j2ee\home\tools.jar;
> C:\j2ee\home\lib;
> C:\j2ee\home\lib\aplWeb.jar;
> C:\j2ee\home\lib\classes12.jar;
> C:\j2ee\home\lib\p6spy.jar;
> C:\j2ee\home\applications\podAdmin-eap\podAdmin-ejb.jar;
> ;
> C:\j2ee\home\applications\podAdmin-eap\podAdmin-web\WEB-INF\classes
>
> The not-found class resides in the WEB-INF/classes directory, which
> for a reason not known to me, has a null element immediately
> before it on the classpath. Everything else on the
> classpath looks reasonable to me.
>
> QUESTIONS
> -------- Would this null element hide my app
> classes from the system class loader ?
>
> If the null element is to blame how might it have gotten into the
> class path ?
>
> BACKGROUND (The only thing I did was ...)
> ---------- This app used to work, before I refactored my ejb classes
> into an abstract superclass and app-specific subclasses. The super
> class implements connection to a single datasource, and a few generic
> business methods such as getDbDate(), getDbName(), etc. Concrete
> subclasses implement the app-specific business methods. Everything
> runs smoothly during build and deploy of the ear file, then at run
> time the class-loading problem shows up.
>
> SPECULATION
> ----------- Given that orion builds the runtime classpath
> for an application, and that it generates stubs and skeletons from
> ejb remote interface class files, is my refactored config of classes the
> problem ?  The null entry on the path comes right after the entry
> inserted by Orion for my ejb jar.
>
> Does orion (or the spec) constrain how an ejb Remote and
> Bean are configured ? Can they be split into super and sub-classes ?
>
> Should I report this as a bug ?
>
> DETAILS
> -------  The exception thrown is:
>   java.lang.ClassNotFoundException: com.allipl.podadmin.PodAdminSession
>
>   The war file structure (per winzip) contains:
>      PodAdminSession.class        Java Class  09/23/2001 6:23 PM
> WEB-INF\classes\com\allipl\podadmin\
>      PodAdminStateMachine.class   Java Class  09/23/2001 6:23 PM
> WEB-INF\classes\com\allipl\podadmin\
>
> Thanks in advance for any suggestions or diagnosis,
>
> Bill.
>
>

Reply via email to