Announcement Announcement Module
No announcement yet.
Spring Web Services 1.5.1 requires Java 5 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Web Services 1.5.1 requires Java 5

    Hi Spring Forum
    I currently am working in a project where we are trying to use Spring Web Services 1.5.1. Our production environment is running Java 1.4.2 on an Oracle OC4J application server 10.1.2. (we cannot yet upgrade to newer Java and Oracle versions due to company polices etc).

    I managed to deploy my webservice application but as soon as it received a webservice call I got the following error.

    java.lang.NoSuchMethodError: java.util.Collections.emptyList()Ljava/util/List;
    at com.sun.xml.messaging.saaj.soap.MessageImpl.<clini t>(
    at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessage Factory1_1Impl.createMessage(SOAPMessageFactory1_1
    at ctory.createWebServiceMessage(SaajSoapMessageFacto
    at eConnection.receive(AbstractWebServiceConnection.j ava:86)
    at eMessageReceiverObjectSupport.handleConnection(Web

    I tracked down the error to the following jar-file: saaj-impl-1.3.jar. Using a Java decompiler I found the following lines of code.

    catch (SecurityException ex)

    nullIter = Collections.emptyList().iterator();

    The Collections.emptyList() is a Java 5 specific call. I downloaded this jar-file with the Spring Web services 1.5.1 with dependencies.

    In the Spring Web Services documentation it states "Spring Web Services runs within a standard Java 1.3 Runtime Environment".

    I tried to replace this jar file with an earlier version. In the end I had to replace a number of jar files. However eventually I got a Java null pointer exception and I gave up.

    It doesn't seem that Spring Webservices 1.5.1 only requires Java 1.3 as specified in the documentation.

  • #2
    SAAJ 1.3 should be compatible with Java 1.4 according to their website

    Probably try to download their saaj-impl.jar.

    Spring works with saaj 1.1, 1.2 and 1.3.
    Probably your application server already ships with an implementation.

    If this does not work, you can try to use the AxiomSoapMessageFactory instead of the SaajSoapMessageFactory.
    See Spring WS Reference Documentation.


    • #3
      You sholdn't use saaj 1.3, look here

      I have the exactly same problem, and I was trying to find saaj 1.2 - it was very difficult.. Eventually, I found axis-saaj-1.2.jar (, (with some additional dependent libs), removed saaj 1.3 library, - and it working now.

      Im hoping, my decision will help somebody
      Last edited by polina; Oct 23rd, 2008, 06:05 AM.


      • #4
        Hi Polina
        Thank you for your reply. I replaced my saaj-impl-1.3.jar with saaj 1.2. Once I restarted my application I got the following error.

        java.lang.NoClassDefFoundError: com/sun/org/apache/xerces/internal/dom/DocumentImpl
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass( :539)

        I resolved this issue by including the following jar file: xercesImpl-1.5.jar

        Restarting my application gave me another class not found exception.

        java.lang.NoClassDefFoundError: com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl
        at eateEnvelope(
        at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1 Impl.createEnvelopeFromSource( :102)

        I resolved this issue by including the following jar file: jaxb-xalan-1.5.jar

        This time I managed to restart my application successfully. In our development environment we are using Tomcat (Pluto) and the application works perfectly. However when I deploy my application to the OC4J server we use in production my application throws a null pointer exception as soon it receives it first webservice call.

        2008-11-04 11:11:29,951 DEBUG [ atcher] - <Endpoint invocation resulted in exception - responding with Fault>
        at essageEndpoint.invokeInternal(TSAMessageEndpoint.j ava:35)
        at PayloadEndpoint.invoke(AbstractDomPayloadEndpoint. java:75)
        at loadEndpointAdapter.invoke(PayloadEndpointAdapter. java:48)
        at spatch(
        at ceive(
        at eMessageReceiverObjectSupport.handleConnection(Web
        at ssageReceiverHandlerAdapter.handle(WebServiceMessa
        at tcherServlet.doService(MessageDispatcherServlet.ja va:197)
        at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
        at org.springframework.web.servlet.FrameworkServlet.d oPost(
        at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
        at com.evermind.server.http.ServletRequestDispatcher. invoke(
        at com.evermind.server.http.ServletRequestDispatcher. forwardInternal(
        at com.evermind.server.http.HttpRequestHandler.proces sRequest(
        at com.evermind.util.ReleasableResourcePooledExecutor $ a:186)
        2008-11-04 11:11:29,966 DEBUG [] - <Sent response [SaajSoapMessage {}Fault] for request [SaajSoapMessage {}clientRequest]>

        Note the line for request [SaajSoapMessage {}clientRequest] in the logs above. It almost looks like that the application fails to parse the incoming message believing it received an empty message. The strange thing is that the application works perfectly on Tomcat but not on OC4J. It behaves differently on different application servers.

        I think I will log this as a separate thread as I believe we are talking about two different problems here. The Java 5 - saaj 1.3 issue originally discussed in this thread has been resolved. This is an issue regarding Spring WS not working properly on the OC4J application server.


        • #5
          well, I dont know anything about it.. but, maybe... when I was searching for saaj1.2, and all dependant libs ( - there are always variants (implementations) of these libs specially are made by oracle.. or something so. Maybe you should try to use them.

          By the way, these libs are successfully deployed under not only tomcat, but also websphere

          didnt find your new thread,so im replying here, sorry


          • #6
            I was finally able to make it work. There is an issue regarding using Spring Webservices on an OC4J application server.

            This has already been addressed in the thread "Java 1.4 and Spring-ws on OC4J 9."

            For the JRE used by the OC4J container I created the following directory
            jre/lib/endorsed. I placed the following jar-files in this directory


            I then bounced the OC4J instance. After that the application was able to parse the incoming webservice messages correctly!