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!
the WAR file contains (in WEB-INF/lib) a library p with classes
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 ?
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
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,
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
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.