FULL PRODUCT VERSION :
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
probably all others
A DESCRIPTION OF THE PROBLEM :
jar i main.jar lib1.jar lib2.jar
it is not possible to use service provider configuration in META-INF, because the META-INF is not listed in the INDEX.LIST in main.jar.
When providing e.g mail.jar as one of the libs, the mailcap file can not be found.
This makes jar indexing difficult to use, because all META-INF data must be manually transferred to the main jar.
If the reader never used jar indexing before, please look at:
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. take one jar file as main.jar and list lib1.jar in the class-path attribute of mainfest
2. take sun's mail.jar as lib1.jar
jar i main.jar lib1.jar
4. Try to load the resource META-INF/mailcap via the classloader
EXPECTED VERSUS ACTUAL BEHAVIOR :
we expect, that META-INF/mailcap is found, because lib1.jar is listed in class-path attribute of mainfest
resource is not found
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
As mentioned above, the jars can be organized in such a way, that all service provider information is found only in main.jar.
An ant snippet would look like this:
index="true" jarfile="main.jar" basedir="classes">
<attribute name="Class-Path" value="lib1.jar lib2.jar"/>
<zipfileset src="lib1.jar" excludes="*.LIST *.RSA. *.SF" includes="META-INF/**"/>
<zipfileset src="lib2.jar" excludes="*.LIST *.RSA. *.SF" includes="META-INF/**"/>
Can this be fixed, or is it just a lack of documention and understanding?