Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6315751

IllegalStateException while decoding the body if it has a fault

XMLWordPrintable

    • 6
    • b60
    • sparc
    • solaris_9

      When the soap body has fault, while decoding the body, it throws Illegal;StateException.
      Its trying to de-serialize this soap message:
      <?xml version="1.0" ?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Receiver</faultcode><faultstring>Person Not Found</faultstring><detail><PersonNotFoundException xmlns="http://example.com/auctiontraq/schemas/doclit"><Name><fname>Foo</fname><lname>Bar</lname></Name><ExMessage>No Person found with this Name</ExMessage><ExMessage>Please try again</ExMessage></PersonNotFoundException></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

      Here is the stacktrace.

           [java] java.lang.IllegalStateException: Current state END_ELEMENT is not among the statesCHARACTERS, COMMENT, CDATA, SPACE, ENTITY_REFERENCE, DTD valid for getText()
           [java] at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.getText(XMLStreamReaderImpl.java:967)
           [java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.decodeFault(SOAPXMLDecoder.java:254)
           [java] at com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeBodyContent(SOAPDecoder.java:247)
           [java] at com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeBody(SOAPDecoder.java:231)
           [java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.decodeBody(SOAPXMLDecoder.java:128)
           [java] at com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeEnvelope(SOAPDecoder.java:164)
           [java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toInternalMessage(SOAPXMLDecoder.java:191)
           [java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:357)
           [java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:183)
           [java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:93)
           [java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:73)
           [java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:161)
           [java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:94)
           [java] at $Proxy25.getPersonByNamePO1(Unknown Source)
           [java] at auctiontraq.at_wsdl_doclit.client.sync.AuctionTraqStaticClient4.invokeGetPersonByName_PO1(AuctionTraqStaticClient4.java:181)
           [java] at auctiontraq.at_wsdl_doclit.client.AuctionTraqDriver.runStaticClient(AuctionTraqDriver.java:163)
           [java] at auctiontraq.at_wsdl_doclit.client.AuctionTraqDriver.doIt(AuctionTraqDriver.java:63)
           [java] at auctiontraq.at_wsdl_doclit.client.AuctionTraqDriver.main(AuctionTraqDriver.java:19)
           [java] java.lang.NullPointerException
           [java] at com.sun.xml.ws.encoding.soap.ClientEncoderDecoder.toMessageInfo(ClientEncoderDecoder.java:62)
           [java] at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toMessageInfo(SOAPXMLDecoder.java:139)
           [java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:361)
           [java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:183)
           [java] at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:93)
           [java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:73)
           [java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:161)
           [java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:94)
           [java] at $Proxy25.getPersonByNamePO1(Unknown Source)
           [java] at auctiontraq.at_wsdl_doclit.client.sync.AuctionTraqStaticClient4.invokeGetPersonByName_PO1(AuctionTraqStaticClient4.java:181)
           [java] at auctiontraq.at_wsdl_doclit.client.AuctionTraqDriver.runStaticClient(AuctionTraqDriver.java:163)
           [java] at auctiontraq.at_wsdl_doclit.client.AuctionTraqDriver.doIt(AuctionTraqDriver.java:63)
           [java] at auctiontraq.at_wsdl_doclit.client.AuctionTraqDriver.main(AuctionTraqDriver.java:19)

            nbajajsunw Neeraj Bajaj (Inactive)
            ramap Rama Pulavarthi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: