Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-2313

JAXBBlockImpl block object is already consumed on client trying to deserialize 2 holders and 1 return string

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • jaxws
    • None

    Description

      When the client gets back a response, it throws a "JAXBBlockImpl block object is already consumed" exception. Reason is in RPCLitMethodMarshaller aorund line 348, we use MethodMarshallerUtils.getReturnElement to get back the return string. but then line 368, we call MethodMarshallerUtils.getPDElements and try to unmarshal the other 2 holders. So we get an exception saying that the block is already consumed.

      thanks,
      dims

      ====================== Service Signature ====================================
      @WebService
      @SOAPBinding(style=SOAPBinding.Style.RPC, use=SOAPBinding.Use.LITERAL)

      @WebMethod
      public String hello3(@WebParam (name="id", targetNamespace="hello3/Name", header=true) String name, @WebParam (name="Name", mode=WebParam.Mode.OUT) Holder<Name> name2, @WebParam (name="Employee", mode=WebParam.Mode.INOUT) Holder<Employee> employee) throws NameException {

      }
      ======================== Client ==================================

      Name name = new Name();
      Employee employee = new Employee();

      Holder<Name> nameHolder = new Holder<Name>();
      Holder<Employee> employeeHolder = new Holder<Employee>();

      name.setFirstName("k");
      name.setLastName("l");
      employee.setName(name);

      employeeHolder.value = employee;

      String result = port.hello3("xyz", nameHolder, employeeHolder);

      ==================================== Request ===========================

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header>
      <ns3:id xmlns:ns3="hello3/Name" xmlns:ns2="http://server.webparam3.webparam/">xyz</ns3:id>
      </soapenv:Header>
      <soapenv:Body>
      <rpcOp:hello3 xmlns:rpcOp="http://server.webparam3.webparam/">
      <Employee xmlns:ns3="hello3/Name">
      <name>
      <firstName>k</firstName>
      <lastName>l</lastName>
      </name>
      <type>0</type>
      </Employee>
      </rpcOp:hello3>
      </soapenv:Body>
      </soapenv:Envelope>

      ================================== Response ======================

      <rpcOp:hello3Response xmlns:rpcOp="http://server.webparam3.webparam/">
      <return>Hello xyz to Web Service</return>
      <Name>
      <firstName>abc</firstName>
      <lastName>def</lastName>
      </Name>
      <Employee>
      <address>
      <city>San Francisco</city>
      <country>U.S.</country>
      <email/>
      <phone/>
      <state>CA</state>
      <street/>
      <zipcode>94104</zipcode>
      </address>
      <dept>
      <location>S.F.</location>
      <name>Eng</name>
      </dept>
      <name>
      <firstName>abc</firstName>
      <lastName>def</lastName>
      </name>
      <salary>
      <bonusPercentage>0</bonusPercentage>
      <currency>USD</currency>
      <salary>0</salary>
      </salary>
      <title/>
      <type>0</type>
      </Employee>
      </rpcOp:hello3Response>

      =================================== Stack Trace =================================

      03-12-2007 14:01:49: ERROR: Exception occurred: An internal error occurred. The org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl block object is already consumed. Processing cannot continue. Run with the debug option to determine where the block was first consumed.
      03-12-2007 14:01:49: ERROR: Exception at:
      03-12-2007 14:01:49: ERROR: javax.xml.ws.WebServiceException: An internal error occurred. The org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl block object is already consumed. Processing cannot continue. Run with the debug option to determine where the block was first consumed.
      at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:177)
      at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:79)
      at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:124)
      at org.apache.axis2.jaxws.message.impl.BlockImpl.getXMLStreamReader(BlockImpl.java:196)
      at org.apache.axis2.jaxws.message.impl.BlockImpl.getReader(BlockImpl.java:222)
      at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.getDirectReader(OMSourcedElementImpl.java:123)
      at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.forceExpand(OMSourcedElementImpl.java:146)
      at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.getBuilder(OMSourcedElementImpl.java:341)
      at org.apache.axis2.jaxws.message.impl.BlockImpl.getBusinessObject(BlockImpl.java:139)
      at org.apache.axis2.jaxws.message.impl.XMLSpineImpl._getBlockFromOMElement(XMLSpineImpl.java:485)
      at org.apache.axis2.jaxws.message.impl.XMLSpineImpl.getBodyBlock(XMLSpineImpl.java:286)
      at org.apache.axis2.jaxws.message.impl.XMLPartBase.getBodyBlock(XMLPartBase.java:491)
      at org.apache.axis2.jaxws.message.impl.MessageImpl.getBodyBlock(MessageImpl.java:315)
      at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.getPDElements(MethodMarshallerUtils.java:234)

      =====================================================================================

      Attachments

        Activity

          People

            scheu@us.ibm.com Rich Scheuerle
            dims Davanum Srinivas
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: