Problem with class loading
906784Dec 21 2011 — edited Jan 17 2012Dear all,
I am currently having troubles resolving an issue that's been bothering me for quite some time now.
I am developing an application based on a client-server architecture. I have implemented birt on the server side to generate reports. The Birt platform is due to startup right after the server has started.
At startup, Birt has all the class contained in the api folder loaded. For some reason, birt startup fails. Birt loads all the application libraries with the following line of code:
Enumeration<URL> plugins = ServiceLauncher.class.getClassLoader( ).getResources( "META-INF/MANIFEST.MF" );
It then iterates through the plugins variable. The Birt startup fails because all the libraries are not loaded. It appears that the class loader stops when loading one of my jar files. I temporarily resolved this issue with two hacks and no explanations:
- The class-path in the MANIFEST.MF file is generated with Maven and is block-shaped. I put the jars in the classpath one under the other.
- Removing the INDEX.LIST file of the same jar (Whenever I remove a jar that is not loaded from this file, it is then loaded).
I can't figure out the reasons of the problem even though I managed to hack a quick workaround, for instance configuring maven to not generate an INDEX.LIST file or manually modifying the classpath, but i'd rather use a neat solution.
Can anyone provide some insight on how to solve this?
Thanks