Announcement Announcement Module
Collapse
No announcement yet.
Error accessing spring-ws echo client program. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error accessing spring-ws echo client program.

    Hi,

    I am trying to run spring-ws echo sample client program. I am able to view the wsdl file (http://localhost:9080/springws/echo/services/echo.wsdl) and my wsdl file looks like

    <?xml version="1.0" encoding="UTF-8" ?>
    - <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:schema="http://localhost:9080/springws/echo" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://localhost:9080/springws/echo">
    - <wsdl:types>
    - <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://localhost:9080/springws/echo" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://localhost:9080/springws/echo">
    - <element name="echoRequest">
    - <simpleType>
    - <restriction base="string">
    <pattern value="([A-Z]|[a-z])+" />
    </restriction>
    </simpleType>
    </element>
    <element name="echoResponse" type="string" />
    </schema>
    </wsdl:types>
    - <wsdl:message name="echoResponse">
    <wsdlart element="schema:echoResponse" name="echoResponse" />
    </wsdl:message>
    - <wsdl:message name="echoRequest">
    <wsdlart element="schema:echoRequest" name="echoRequest" />
    </wsdl:message>
    - <wsdlortType name="Echo">
    - <wsdl:operation name="echo">
    <wsdl:input message="schema:echoRequest" name="echoRequest" />
    <wsdl:output message="schema:echoResponse" name="echoResponse" />
    </wsdl:operation>
    </wsdlortType>
    - <wsdl:binding name="EchoBinding" type="schema:Echo">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="echo">
    <soap:operation soapAction="" />
    - <wsdl:input name="echoRequest">
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output name="echoResponse">
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:service name="EchoService">
    - <wsdlort binding="schema:EchoBinding" name="EchoPort">
    <soap:address location="http://localhost:9080/springws/echo/services" />
    </wsdlort>
    </wsdl:service>
    </wsdl:definitions>

    But when i am trying to access the spring-ws i am getting error:

    [4/10/08 10:09:50:888 EDT] 00000023 ServletWrappe A SRVE0242I: [IRISWS] [/springws] [spring-ws]: Initialization successful.
    [4/10/08 10:09:50:903 EDT] 00000023 ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet spring-ws. Exception thrown : org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is java.lang.NoSuchMethodError: java/util/Collections.emptyList()Ljava/util/List;
    Caused by: java.lang.NoSuchMethodError: java/util/Collections.emptyList()Ljava/util/List;
    at com.sun.xml.messaging.saaj.soap.MessageImpl.<clini t>(MessageImpl.java:755)
    at java.lang.Class.initializeImpl(Native Method)
    at java.lang.Class.initialize(Class.java:345)
    at com.sun.xml.messaging.saaj.soap.MessageFactoryImpl .createMessage(MessageFactoryImpl.java:81)
    at org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory.createWebServiceMessage(SaajSoapMessageFacto ry.java:164)
    at org.springframework.ws.transport.AbstractWebServic eConnection.receive(AbstractWebServiceConnection.j ava:53)
    at org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handleConnection(Web ServiceMessageReceiverObjectSupport.java:86)
    at org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.java:57)
    at org.springframework.ws.transport.http.MessageDispa tcherServlet.doService(MessageDispatcherServlet.ja va:197)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:475)
    at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:440)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:763)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java:1572)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:762)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleReques t(WebApp.java:3071)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequ est(WebGroup.java:236)
    at com.ibm.ws.webcontainer.VirtualHost.handleRequest( VirtualHost.java:210)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:1958)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java:89)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java:472)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewInformation(HttpInboundLink.java:411)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.ready(HttpInboundLink.java:288)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialRe adCallback.sendToDiscriminaters(NewConnectionIniti alReadCallback.java:207)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialRe adCallback.complete(NewConnectionInitialReadCallba ck.java:109)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.reque stComplete(WorkQueueManager.java:566)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attem ptIO(WorkQueueManager.java:619)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.worke rRun(WorkQueueManager.java:952)
    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worke r.run(WorkQueueManager.java:1039)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1471)

    my applicationContext.xml is:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <bean id="echoClient" class="com.jpmc.echo.client.EchoClient">
    <property name="defaultUri" value="http://localhost:9080/springws/echo/services"/>
    <property name="request" value="classpath:com/jpmc/echo/client/echo.xml"/>
    </bean>

    </beans>

    echo.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <echoRequest xmlns="http://localhost:9080/springws/echo/service">Hello</echoRequest>

    and echoClient program is:

    public class EchoClient extends WebServiceGatewaySupport {

    private Resource request;

    public void setRequest(Resource request) {
    this.request = request;
    }

    public void echo() throws IOException {
    System.out.println("inside echo method");
    Source requestSource = new ResourceSource(request);
    System.out.println("requestSource==>"+requestSourc e);
    StringResult result = new StringResult();
    getWebServiceTemplate().sendSourceAndReceiveToResu lt(requestSource, result);
    System.out.println(result);
    }

    public static void main(String[] args) throws IOException {
    ApplicationContext applicationContext =
    new ClassPathXmlApplicationContext("applicationContext .xml", EchoClient.class);
    EchoClient echoClient = (EchoClient) applicationContext.getBean("echoClient");
    echoClient.echo();
    }

    }


    Does any one has idea why i am getting the above error?

    Thanks!

  • #2
    My guess is that you're compiling and running with a JVM that's too old. Which JVM are you using? I'd recommend JDK 1.5 or higher.

    %

    Comment


    • #3
      I have requirement to use JDK 1.4.2.

      Comment


      • #4
        I'm working with Spring WS 1.5 myself. There are six (6) samples in my download. I've got echo, pox, and tutorial working. The other three, airline, stockquote, and mtom have issues.

        But echo does work just fine.

        %

        Comment


        • #5
          Originally posted by Supriya View Post
          I have requirement to use JDK 1.4.2.
          Then you can't run those samples.

          %

          Comment


          • #6
            On spring site it says that they do support JDK1.4.2. Only there are few jars which is different. So i guess it should work for JDK 1.4.2. Anyways, could you please give me the working copy fo those samples?

            Comment


            • #7
              No, sorry, can't do it.

              %

              Comment


              • #8
                Originally posted by Supriya View Post
                On spring site it says that they do support JDK1.4.2. Only there are few jars which is different. So i guess it should work for JDK 1.4.2. Anyways, could you please give me the working copy fo those samples?
                Spring does run on JDK 1.4.2. I'm just not sure that the WS samples do.

                You have the answer - echo does not.

                %

                Comment


                • #9
                  Can u give me the working copy which u have?

                  Comment


                  • #10
                    I am able to resolve the above problem though i got stuch with another problem. Now i am getting

                    [4/10/08 14:55:04:302 EDT] 0000001e soap E SAAJ0511: Unable to create envelope from given source
                    [4/10/08 14:55:04:302 EDT] 0000001e ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet spring-ws. Exception thrown : org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is java.lang.UnsupportedOperationException
                    Caused by: java.lang.UnsupportedOperationException
                    at com.sun.xml.messaging.saaj.soap.MessageFactoryImpl .createMessage(MessageFactoryImpl.java:49)
                    at org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory.createWebServiceMessage(SaajSoapMessageFacto ry.java:141)
                    at org.springframework.ws.context.DefaultMessageConte xt.getResponse(DefaultMessageContext.java:66)
                    at org.springframework.ws.soap.server.endpoint.Simple SoapExceptionResolver.resolveExceptionInternal(Sim pleSoapExceptionResolver.java:61)
                    at org.springframework.ws.server.endpoint.AbstractEnd pointExceptionResolver.resolveException(AbstractEn dpointExceptionResolver.java:81)
                    at org.springframework.ws.server.MessageDispatcher.pr ocessEndpointException(MessageDispatcher.java:306)
                    at org.springframework.ws.server.MessageDispatcher.di spatch(MessageDispatcher.java:230)
                    at org.springframework.ws.server.MessageDispatcher.re ceive(MessageDispatcher.java:163)
                    at org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handleConnection(Web ServiceMessageReceiverObjectSupport.java:88)
                    at org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.java:57)
                    at org.springframework.ws.transport.http.MessageDispa tcherServlet.doService(MessageDispatcherServlet.ja va:197)
                    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:475)
                    at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:440)
                    at javax.servlet.http.HttpServlet.service(HttpServlet .java:763)
                    at javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
                    at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java:1572)
                    at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:762)
                    at com.ibm.ws.webcontainer.webapp.WebApp.handleReques t(WebApp.java:3071)
                    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequ est(WebGroup.java:236)
                    at com.ibm.ws.webcontainer.VirtualHost.handleRequest( VirtualHost.java:210)
                    at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:1958)
                    at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java:89)
                    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java:472)
                    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewInformation(HttpInboundLink.java:411)
                    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.ready(HttpInboundLink.java:288)
                    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialRe adCallback.sendToDiscriminaters(NewConnectionIniti alReadCallback.java:207)
                    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialRe adCallback.complete(NewConnectionInitialReadCallba ck.java:109)
                    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.reque stComplete(WorkQueueManager.java:566)
                    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attem ptIO(WorkQueueManager.java:619)
                    at com.ibm.ws.tcp.channel.impl.WorkQueueManager.worke rRun(WorkQueueManager.java:952)
                    at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worke r.run(WorkQueueManager.java:1039)
                    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1471)

                    my my request xml look like :

                    <?xml version="1.0" encoding="UTF-8"?>
                    <ec:EchoRequest xmlns:ec="http://www.averconsulting.com/echo/schemas" elementFormDefault="qualified">
                    <ec:Echo>
                    <ec:Name>Test message</ec:Name>
                    </ec:Echo>
                    </ec:EchoRequest>

                    and the schema file is:


                    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                    xmlns:ec="http://www.averconsulting.com/echo/schemas" elementFormDefault="qualified"
                    targetNamespace="http://www.averconsulting.com/echo/schemas">
                    <xs:element name="EchoRequest">
                    <xs:complexType>
                    <xs:all>
                    <xs:element name="Echo" type="ec:EchoType"/>
                    </xs:all>
                    </xs:complexType>
                    </xs:element>
                    <xs:element name="EchoResponse">
                    <xs:complexType>
                    <xs:all>
                    <xs:element name="EchoResponse" type="ec:ReturnType"/>
                    </xs:all>
                    </xs:complexType>
                    </xs:element>
                    <xs:complexType name="EchoType">
                    <xs:sequence>
                    <xs:element name="Name" type="xs:string"/>
                    </xs:sequence>
                    </xs:complexType>

                    <xs:complexType name="ReturnType">
                    <xs:sequence>
                    <xs:element name="Message" type="xs:string"/>
                    </xs:sequence>
                    </xs:complexType>
                    </xs:schema>


                    I am really frustated. Does any body has any idea what might be causing this issue.

                    Thanks!

                    Comment


                    • #11
                      Does any one know how to set the java.endorsed.dirs system property? Looks like this is the root cause for echo sample, which does not work for j2sdk1.4.

                      Comment

                      Working...
                      X