Axis2
  1. Axis2
  2. AXIS2-4228

SAAJ test cases no longer work with IBM's SDK

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: saaj
    • Labels:
      None

      Description

      In rev. 733910, the introduction of the custom test runners broke the tests when the tests are built with IBM's JDK.

      The paths to the following factories are different for IBM:

      System.setProperty("javax.xml.soap.MessageFactory",
      "com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
      System.setProperty("javax.xml.soap.SOAPFactory",
      "com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl");
      System.setProperty("javax.xml.soap.SOAPConnectionFactory",
      "com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory");
      System.setProperty("javax.xml.soap.MetaFactory",
      "com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl");

      The simple fix is to properly set these system properties when using IBM's JDK.

        Activity

        Hide
        Andreas Veithen added a comment -

        I added a comment in the pom.xml explaining why we need the jaxp-ri dependency and removed the System.out.println in SAAJTestRunner. I think we can close this issue.

        Show
        Andreas Veithen added a comment - I added a comment in the pom.xml explaining why we need the jaxp-ri dependency and removed the System.out.println in SAAJTestRunner. I think we can close this issue.
        Hide
        Andreas Veithen added a comment -

        I saw the 2 test failures with the 1.6 JDK bundled with IBM's Eclipse distribution [1]. It has something to do with null namespaces (<text xmlns="">). This JDK also has a bug that causes Maven to crash [2], so that I'm not able to debug this in an effective way. I also tested with the latests 1.6 JDK from IBM on Linux and there it works.

        [1] http://www.ibm.com/developerworks/java/jdk/eclipse/
        [2] http://jira.codehaus.org/browse/MNG-3580

        Show
        Andreas Veithen added a comment - I saw the 2 test failures with the 1.6 JDK bundled with IBM's Eclipse distribution [1] . It has something to do with null namespaces (<text xmlns="">). This JDK also has a bug that causes Maven to crash [2] , so that I'm not able to debug this in an effective way. I also tested with the latests 1.6 JDK from IBM on Linux and there it works. [1] http://www.ibm.com/developerworks/java/jdk/eclipse/ [2] http://jira.codehaus.org/browse/MNG-3580
        Hide
        Roy A. Wood Jr. added a comment -

        Hi,

        Yes, the 'jaxp-ri' dependency worked fine for me also...Thank you. Also, I tested this with both JDK (Sun and IBM) and all the tests worked fine for me; I wasn't able to reproduce that 2 tests failures that you mentioned. However, the problems you see may go away if you build all of axis2 before running the tests. I'll back out my changes for SAAJTestRunner.java and put your new pom changes in...Thanks Andreas

        Show
        Roy A. Wood Jr. added a comment - Hi, Yes, the 'jaxp-ri' dependency worked fine for me also...Thank you. Also, I tested this with both JDK (Sun and IBM) and all the tests worked fine for me; I wasn't able to reproduce that 2 tests failures that you mentioned. However, the problems you see may go away if you build all of axis2 before running the tests. I'll back out my changes for SAAJTestRunner.java and put your new pom changes in...Thanks Andreas
        Hide
        Andreas Veithen added a comment -

        I tested the build with the additional jaxp-ri dependency on IBM JDK 1.6 and this solves the NoClassDefFoundError problem. However there are two remaining test failures (in tests I recently added) which are probably real issues.

        Show
        Andreas Veithen added a comment - I tested the build with the additional jaxp-ri dependency on IBM JDK 1.6 and this solves the NoClassDefFoundError problem. However there are two remaining test failures (in tests I recently added) which are probably real issues.
        Hide
        Andreas Veithen added a comment -

        Can you try the tests with the following additional dependency (which should contain the missing classes)?

        <dependency>
        <groupId>com.sun.xml.parsers</groupId>
        <artifactId>jaxp-ri</artifactId>
        <version>1.4.2</version>
        <scope>test</scope>
        </dependency>

        Show
        Andreas Veithen added a comment - Can you try the tests with the following additional dependency (which should contain the missing classes)? <dependency> <groupId>com.sun.xml.parsers</groupId> <artifactId>jaxp-ri</artifactId> <version>1.4.2</version> <scope>test</scope> </dependency>
        Hide
        Andreas Veithen added a comment -

        SOAPDocumentImpl is part of saaj-impl, but it extends DocumentImpl from Sun's internal copy of Xerces! This should explain the problem you see on IBM's JDK. I will have a look at the available versions of saaj-impl to see if there is one that doesn't have this problem.

        Other question: is SAAJ part of the IBM JDK version 1.5?

        Show
        Andreas Veithen added a comment - SOAPDocumentImpl is part of saaj-impl, but it extends DocumentImpl from Sun's internal copy of Xerces! This should explain the problem you see on IBM's JDK. I will have a look at the available versions of saaj-impl to see if there is one that doesn't have this problem. Other question: is SAAJ part of the IBM JDK version 1.5?
        Hide
        Roy A. Wood Jr. added a comment -

        Hi Andreas,

        I mostly use Maven to run the tests and I did notice that the pom file specifies where the factory implementations are. However, with the change that was introduced in
        rev. 733910, we (IBM JDK users) started getting the following test errors in saaj tests:

        Caused by: java.lang.NoClassDefFoundError: com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl
        at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.<init>(SOAPPartImpl.java:119)
        at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:109)
        at com.sun.xml.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:400)
        ... 30 more

        CAUSE:

        java.lang.NoClassDefFoundError: com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl
        at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.<init>(SOAPPartImpl.java:119)
        at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:109)
        at com.sun.xml.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:400)
        at com.sun.xml.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:309)
        at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:93)
        at org.apache.axis2.saaj.SOAPEnvelopeTest.testDetachBody(SOAPEnvelopeTest.java:114)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)

        -----------------------------------------------

        This may somehow be a problem with processing the pom file when using IBM's JDK. This does get us past the test problems,
        but you're correct that we should probably not be using two different implementations. I'll look at this some more and am open to suggestions as well.

        Show
        Roy A. Wood Jr. added a comment - Hi Andreas, I mostly use Maven to run the tests and I did notice that the pom file specifies where the factory implementations are. However, with the change that was introduced in rev. 733910, we (IBM JDK users) started getting the following test errors in saaj tests: Caused by: java.lang.NoClassDefFoundError: com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.<init>(SOAPPartImpl.java:119) at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:109) at com.sun.xml.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:400) ... 30 more CAUSE: java.lang.NoClassDefFoundError: com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.<init>(SOAPPartImpl.java:119) at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:109) at com.sun.xml.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:400) at com.sun.xml.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:309) at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:93) at org.apache.axis2.saaj.SOAPEnvelopeTest.testDetachBody(SOAPEnvelopeTest.java:114) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45) ----------------------------------------------- This may somehow be a problem with processing the pom file when using IBM's JDK. This does get us past the test problems, but you're correct that we should probably not be using two different implementations. I'll look at this some more and am open to suggestions as well.
        Hide
        Andreas Veithen added a comment -

        The factory implementations are all provided by com.sun.xml.messaging.saaj:saaj-impl:1.3.2 (added in scope test in the POM file), and not the JDK (they are not even present on Sun's JDK). How do you run the tests? Using Maven or using an IDE?

        Show
        Andreas Veithen added a comment - The factory implementations are all provided by com.sun.xml.messaging.saaj:saaj-impl:1.3.2 (added in scope test in the POM file), and not the JDK (they are not even present on Sun's JDK). How do you run the tests? Using Maven or using an IDE?

          People

          • Assignee:
            Roy A. Wood Jr.
            Reporter:
            Roy A. Wood Jr.
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development