[java-sig-commits] [Bug 796739] New: Missing service provider configuration files in the woodstox jar files

bugzilla at redhat.com bugzilla at redhat.com
Thu Feb 23 15:22:37 UTC 2012


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.

Summary: Missing service provider configuration files in the woodstox jar files

https://bugzilla.redhat.com/show_bug.cgi?id=796739

           Summary: Missing service provider configuration files in the
                    woodstox jar files
           Product: Fedora
           Version: rawhide
          Platform: Unspecified
        OS/Version: Linux
            Status: NEW
          Severity: medium
          Priority: unspecified
         Component: woodstox-core
        AssignedTo: jcapik at redhat.com
        ReportedBy: juan.hernandez at redhat.com
         QAContact: extras-qa at fedoraproject.org
                CC: java-sig-commits at lists.fedoraproject.org,
                    jcapik at redhat.com
    Classification: Fedora
      Story Points: ---
              Type: ---
        Regression: ---
        Mount Type: ---
     Documentation: ---


Description of problem:

The jar files provided in the woodstox-jar package don't contain the service
provider configuration files needed to use the 

Version-Release number of selected component (if applicable):

woodstox-core-4.1.2-2.fc17.x86_64

How reproducible:

Always.

Steps to Reproduce:

1. Write and compile the following java program:

import javax.xml.stream.XMLInputFactory;

public class Test {
  public static void main(String[] args) throws Exception {
    System.out.println(XMLInputFactory.newInstance());
  }
}

2. Run it with the version of the "woodstox-core-asj.jar" provided by the RPM:

$ java -cp $(build-classpath woodstox-core stax2-api):. Test

Actual results:

com.sun.xml.internal.stream.XMLInputFactoryImpl at 605df3c5

It is using the internal implementation provided by the JDK.

Expected results:

com.ctc.wstx.stax.WstxInputFactory at a5ae1e7

It should use the implementation provided by the woodstox-core package.

Additional info:

I believe that the problem is that the service provider configuration files
that are available in the source of the package in the "src/resources"
directory are not copied to the "META-INF/services" directory of the generated
jar files.

This can be fixed with the following patch for the spec:

--- a/woodstox-core.spec
+++ b/woodstox-core.spec
@@ -64,7 +64,6 @@ sed -i "s/@REQ_STAX2_VERSION@/%{stax2_ver}/g" pom.xml
pom-lgpl.xml
 # removing bundled stuff
 rm -rf lib
 rm -rf src/maven
-rm -rf src/resources
 rm -rf src/samples
 rm -rf src/java/org
 rm -rf src/test/org
@@ -76,6 +75,11 @@ mv -f src/java src/main/
 mkdir src/test/java
 mv -f src/test/wstxtest src/test/java/

+# Make sure that the service provider configuration files end up
+# in the META-INF/services directory of the resulting jar files:
+mkdir -p src/main/resources/META-INF/services
+cp src/resources/* src/main/resources/META-INF/services/.
+
 %build
 # stax2 missing -> cannot compile tests -> tests skipped
 mvn-rpmbuild -Dmaven.test.skip=true \

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the java-sig-commits mailing list