This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/20941] New: Incorrect case for META-INF with fastjar


This case came to light making service provider property files for
GNU JAXP: org.xml.sax.driver etc. These should be created in the 
META-INF/services path of the JAR. Reproduce this error by creating a 
META-INF/services directory at the root of your compiled class hierarchy and 
adding one or more property files (attached) and call fastjar without the M 
argument. Compiled classes in /build with the service provider at:

/build/META-INF/services/org.xml.sax.driver

cd /build

jar cvf /lib/gnu-jaxp.jar .

GNU fastjar takes the file system directory name META-INF and 
correctly creates the service provider directory in the JAR, but it 
also creates a default manifest file at meta-inf/Manifest.mf.

When I run my JAXP application with gij, it seems to read meta-inf 
by default, ignore the META-INF path and cannot resolve a SAX driver to
instantiate. If I suppress the default manifest with the fastjar M
argument, no lowercase meta-inf path is created, the uppercase META-INF
path is processed and the SAX driver is loaded.

jar cvfM /lib/gnu-jaxp.jar .

The Sun JAR specification [1] does not say META-INF must be 
uppercase, but all the examples are in upper case and broader reading
suggests that uppercase path is expected. The attached test case confirms the 
Sun JVM expects an uppercase META-INF, so it seems gij is not at fault.

gij --classpath .:$CLASSPATH:/lib/gnu-jaxp.jar XMLReaderTest

java -classpath g:\lib\gnu-jaxp.jar XMLReaderTest

XMLReader created with hard-coded value.



[1] http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html

-- 
           Summary: Incorrect case for META-INF with fastjar
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: phil at mkdoc dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20941


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]