Announcement Announcement Module
Collapse
No announcement yet.
JDOM/AXIOM response error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JDOM/AXIOM response error

    I'm creating the following response using the AbstractJDomPayloadEndpoint.

    Code:
    Namespace namespace = Namespace.getNamespace("test", "http://www.testing.org/test");
    
    Element response = new Element("testResponse",namespace);
    Element responseCode = (new Element("responseCode",namespace)).setText("Successful");
    Element responseString = (new Element("responseString",namespace)).setText("Loaded Successfully");
    response.addContent(responseCode);
    response.addContent(responseString);
    
    return response;
    When I use SAAJ, I get the following response

    Code:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <env:Body>
          <testResponse xmlns="http://www.tesing.org/test">
             <responseCode>Successful</responseCode>
             <responseString>Loaded Successfully</responseString>
          </testResponse>
       </env:Body>
    </env:Envelope>
    AXIOM gives me the following fault

    Code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Body>
          <soapenv:Fault>
             <faultcode>soapenv:Server</faultcode>
             <faultstring xml:lang="en">Local name may not be null or empty</faultstring>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>
    Log shows the following.

    Code:
    2008-02-22 10:48:47,679 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default'] WARN  org.springframework.ws.soap.server.SoapMessageDispatcher - Endpoint invocation resulted in exception - responding with SOAP Fault
    java.lang.IllegalArgumentException: Local name may not be null or empty
    	at org.apache.axiom.om.impl.llom.OMAttributeImpl.<init>(Ljava.lang.String;Lorg.apache.axiom.om.OMNamespace;Ljava.lang.String;Lorg.apache.axiom.om.OMFactory;)V(OMAttributeImpl.java:52)
    	at org.apache.axiom.om.impl.llom.OMElementImpl.addAttribute(Ljava.lang.String;Ljava.lang.String;Lorg.apache.axiom.om.OMNamespace;)Lorg.apache.axiom.om.OMAttribute;(OMElementImpl.java:532)
    	at org.apache.axiom.om.impl.builder.SAXOMBuilder.startElement(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;Lorg.xml.sax.Attributes;)V(SAXOMBuilder.java:111)
    	at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;Lorg.xml.sax.Attributes;)V(TransformerIdentityImpl.java:1072)
    	at org.jdom.output.SAXOutputter.startElement(Lorg.jdom.Element;Lorg.xml.sax.Attributes;)V(SAXOutputter.java:1025)
    	at org.jdom.output.SAXOutputter.element(Lorg.jdom.Element;Lorg.jdom.output.NamespaceStack;)V(SAXOutputter.java:894)
    	at org.jdom.output.SAXOutputter.elementContent(Lorg.jdom.Content;Lorg.jdom.output.NamespaceStack;)V(SAXOutputter.java:1093)
    	at org.jdom.output.SAXOutputter.elementContent(Ljava.util.List;Lorg.jdom.output.NamespaceStack;)V(SAXOutputter.java:1067)
    	at org.jdom.output.SAXOutputter.output(Ljava.util.List;)V(SAXOutputter.java:666)
    	at org.jdom.transform.JDOMSource$DocumentReader.parse(Lorg.xml.sax.InputSource;)V(JDOMSource.java:479)
    	at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Ljavax.xml.transform.Source;Ljavax.xml.transform.Result;)V(TransformerIdentityImpl.java:484)
    	at org.springframework.xml.transform.TransformerObjectSupport.transform(Ljavax.xml.transform.Source;Ljavax.xml.transform.Result;)V(TransformerObjectSupport.java:75)
    	at org.springframework.ws.server.endpoint.adapter.PayloadEndpointAdapter.invoke(Lorg.springframework.ws.context.MessageContext;Ljava.lang.Object;)V(PayloadEndpointAdapter.java:50)
    	at org.springframework.ws.server.MessageDispatcher.dispatch(Lorg.springframework.ws.context.MessageContext;)V(MessageDispatcher.java:210)
    	at org.springframework.ws.server.MessageDispatcher.receive(Lorg.springframework.ws.context.MessageContext;)V(MessageDispatcher.java:157)
    	at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(Lorg.springframework.ws.transport.WebServiceConnection;Lorg.springframework.ws.transport.WebServiceMessageReceiver;)V(WebServiceMessageReceiverObjectSupport.java:86)
    	at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;Ljava.lang.Object;)Lorg.springframework.web.servlet.ModelAndView;(WebServiceMessageReceiverHandlerAdapter.java:56)
    	at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(MessageDispatcherServlet.java:157)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(FrameworkServlet.java:475)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(FrameworkServlet.java:440)
    	at javax.servlet.http.HttpServlet.service(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(HttpServlet.java:760)
    	at javax.servlet.http.HttpServlet.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(Optimized Method)
    	at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;(ServletStubImpl.java:996)
    	at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(Optimized Method)
    	at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(Optimized Method)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava.lang.Object;(Optimized Method)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(SecurityManager.java:118)
    	at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic.servlet.internal.ServletRequestImpl;Lweblogic.servlet.internal.ServletResponseImpl;)V(WebAppServletContext.java:3661)
    	at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic.kernel.ExecuteThread;)V(ServletRequestImpl.java:2630)
    	at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(ExecuteThread.java:219)
    	at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178)
    Everything else works. It appears to be a problem with how I'm creating my response element, but I'm not sure what I'm missing. Anyone have any thoughts?

  • #2
    This might be a long-shot, but I had a problem earlier when the xsd did not include the
    Code:
    <xs:schema ... elementFormDefault="qualified">
    in my xsd.

    http://forum.springframework.org/sho...160#post165160

    Regards,
    Paul

    Comment


    • #3
      JDOM/AXIOM response error

      No Luck. This appears to be an issue with the JDOM implementation. I tested the same code (used request as response) using DOM, JDOM and DOM4J (on weblogic 8.1 and tomcat 6.0) and JDOM gave the error on both servers, while the others were successful. I'm guessing that JDOM is having an issue with the latest xml parsers, but using older versions cause other errors. Not sure what to do.

      Comment


      • #4
        upgraded to 1.5.0 and problem was fixed.

        Comment

        Working...
        X