-
1. Re: Class not found exception
triathlon98 Jan 30, 2003 1:43 PM (in response to triathlon98)I am starting to realize some extra details.
The statement about it working in 3.0.2 might be false, as I tested that with a war I have running in 3.0.2 but without some other beans.
I have three components deployed, two jars and a war file. The jar files are deplyed before the war file. The war file contains three libraries in WEB-INF/lib, one of these is not loaded. However, one of them (Velocity) is!
JAR1 contains:
class1
class2
p.class1
the WAR file contains (in WEB-INF/lib) a library p with classes
p.class1
p.class2
For some reason the classloader cannot find p.class2. It appears that the deployment of the jar file seales the package "p". This does not look like proper behaviour.
How can this be solved ?
Joachim -
2. Re: Class not found exception
triathlon98 Jan 31, 2003 8:07 AM (in response to triathlon98)After some more checking of the classloader mechanism, I started to see the reason, so I changed direction and created an EAR archive with following structure
ear
_lib
__l.jar
_j.jar
_w.war
in the manifest.mf files for the jar and war file I included "Class-Path: lib/l.jar".
The good news is that everything is fine for j.jar. The bad news that w.jar has a problem finding l.jar if it is deployed as an unpacked archive and a problem finding the jar file in /WEB-INF/lib inside the war file when deployed as a packed archive.
Any clues anybody?
Thanks for the help,
Joachim -
3. Re: Class not found exception
triathlon98 Jan 31, 2003 2:24 PM (in response to triathlon98)Ok, I finally figured out what causes all these problems and have found a solution (in case anybody is interested).
I solved it by structuring my ear differenty.
The ear now has the following structure
ear
_lib
__l.jar
__resources.jar
_j.jar
_w.war
The J.jar and w.war files are quite empty and only include a deployment descriptors and the contents for the site. The resources (which are used by classes in l.jar) are in resources.jar.
Very important, both archives have a "Class-Path: lib/l.jar lib/resources.jar" line in their manifest file (very important to already reference the resources in j.jar, as the j;jar classes use the classpath when loaded to find resources, and don't know about the extensions given by w.war.
Hope this helps somebody.
Joachim