-
1. Re: [Classloader related: JBoss 3.x] Accessing a class from
adrian.brock Sep 15, 2003 3:01 AM (in response to ronaldoc)Classes outside the war will not be able to load
classes from the war unless they use Thread.currentThread().getContextClassLoader().loadClass()
Regards,
Adrian -
2. Re: [Classloader related: JBoss 3.x] Accessing a class from
ronaldoc Sep 15, 2003 6:54 PM (in response to ronaldoc)Adrian,
I'm trying to understand what you said. In my case, say I have Parent.class in Module1.jar (packaged inside MyFramework.ear). Then I have this class Child.class inside StrutsClient.war (which is outside the ear) extending from Parent.class:
public class Child extends org.sf.Parent { .. }
Where would I programmatically make this call:
Thread.currentThread().getContextClassLoader().loadClass()
Thanks a lot.
R -
3. Re: [Classloader related: JBoss 3.x] Accessing a class from
adrian.brock Sep 16, 2003 4:53 AM (in response to ronaldoc)No idea, show the stacktrace where it fails.
I was just giving general advice since you gave no useful
details.
Regards,
Adrian -
4. Re: [Classloader related: JBoss 3.x] Accessing a class from
crobert Sep 16, 2003 7:14 AM (in response to ronaldoc)
Ronaldo,
You probably have to pack StrutsClient.war into the myFramework.ear or add every necessary class from Module1.jar to StrutsClient.war
Use Thread.currentThread().getContextClassLoader().loadClass() if you want to dynamically load classes, but that's not your case: Java is trying to load the parent class but it doesn't find it.
Robert -
5. Re: [Classloader related: JBoss 3.x] Accessing a class from
adrian.brock Sep 16, 2003 7:25 AM (in response to ronaldoc)No that should not be necessary.
The war can see everything in ear because of the UnifiedClassLoader. Duplicating classes will just lead to
ClassCasts.
ClassNotFound is due to a classloading that is the other
way around or use of Class.forName() which uses class
location rather application considerations.
Regards,
Adrian -
6. Re: [Classloader related: JBoss 3.x] Accessing a class from
raja05 Sep 16, 2003 8:54 AM (in response to ronaldoc)Are you getting ur deployments done right? I think the wars get deployed before ear. So if u hve any startup class in ur war using the Parent in the Ear, thats not going to work!!
-Raj