Details

    • Type: Sub-task Sub-task
    • Status: Open Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.2.7
    • Component/s: JAXB 2.0
    • Labels:
      None
    • Environment:
      Trunk version
      Using JAXB2.0 and org.codehaus.xfire.jaxws.JAXWSServiceFactory
    • Number of attachments :
      0

      Description

      When using an array as return type the following error occures:

      org.codehaus.xfire.handler.DefaultFaultHandler > Fault occurred!
      07/04/02 11:11:24.162, SocketListener0-1, org.codehaus.xfire.handler.DefaultFaultHandler.invoke(DefaultFaultHandler.java:39)
      Throwable: javax.xml.stream.XMLStreamException: No open start element, when trying to write end element
      at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1413)
      at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1442)
      at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteEndTag(BaseNsStreamWriter.java:528)
      at com.ctc.wstx.sw.BaseNsStreamWriter.writeEndElement(BaseNsStreamWriter.java:281)
      at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:83)
      at org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpChannel.java:56)
      at org.codehaus.xfire.transport.http.XFireServletChannel.sendViaServlet(XFireServletChannel.java:87)
      at org.codehaus.xfire.transport.http.XFireServletChannel.send(XFireServletChannel.java:44)
      at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
      at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
      at org.codehaus.xfire.service.binding.PostInvocationHandler.invoke(PostInvocationHandler.java:36)
      at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
      at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
      at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
      at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:304)
      at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:129)
      at org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
      at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:654)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:556)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1563)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1515)
      at org.mortbay.http.HttpServer.service(HttpServer.java:956)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

      This returns the following (corrupt) soap message:

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soap:Body>
      <getObjectArrayResponse xmlns="http://list.xfire.ws.soa.util.telindus.be">
      <out xmlns="http://list.xfire.ws.soa.util.telindus.be">
      <MyObject xmlns="http://list.xfire.ws.soa.util.telindus.be">
      <description>description</description>
      </MyObject>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soap:Body>
      <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>Couldn't write message.</faultstring>
      </soap:Fault>
      </soap:Body>
      </soap:Envelope>

        Activity

        Hide
        Tom Lambrechts added a comment -

        This is probably because the ArrayType does a close of the writer when writing the parameter value.

        protected void writeValue(Object value,
        MessageWriter writer,
        MessageContext context,
        Type type,
        String name,
        String ns)
        throws XFireFault
        {
        type = AegisBindingProvider.getWriteType(context, value, type);
        MessageWriter cwriter;
        if (type.isWriteOuter())

        { cwriter = writer.getElementWriter(name, ns); }

        else

        { cwriter = writer; }

        if (value==null && type.isNillable())
        cwriter.writeXsiNil();
        else
        type.writeObject( value, cwriter, context );

        //TODO bug report
        // cwriter.close();
        }

        This causes the 'out' element to be closed. This is the root cause of the issue.

        Show
        Tom Lambrechts added a comment - This is probably because the ArrayType does a close of the writer when writing the parameter value. protected void writeValue(Object value, MessageWriter writer, MessageContext context, Type type, String name, String ns) throws XFireFault { type = AegisBindingProvider.getWriteType(context, value, type); MessageWriter cwriter; if (type.isWriteOuter()) { cwriter = writer.getElementWriter(name, ns); } else { cwriter = writer; } if (value==null && type.isNillable()) cwriter.writeXsiNil(); else type.writeObject( value, cwriter, context ); //TODO bug report // cwriter.close(); } This causes the 'out' element to be closed. This is the root cause of the issue.
        Hide
        Dan Diephouse added a comment -

        Thanks Tom. Scheduling for 1.2.6.

        Show
        Dan Diephouse added a comment - Thanks Tom. Scheduling for 1.2.6.
        Hide
        Ravi Kant Singh added a comment -

        Hi,

        Has this issue been fixed? I am still seeing this while returning an array of custom objects (using Xfire 1.2.6).

        Can someone please suggest a work-around?

        Thanks,
        Ravi

        Exception trace begin:
        ===================
        org.codehaus.xfire.handler.DefaultFaultHandler | Fault occurred!
        javax.xml.stream.XMLStreamException: No open start element, when trying to write end element
        at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1413)
        at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1442)
        at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteEndTag(BaseNsStreamWriter.java:528)
        at com.ctc.wstx.sw.BaseNsStreamWriter.writeEndElement(BaseNsStreamWriter.java:281)
        at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:82)
        at org.codehaus.xfire.util.OutMessageDataSource.createInputStream(OutMessageDataSource.java:92)
        at org.codehaus.xfire.util.OutMessageDataSource.<init>(OutMessageDataSource.java:37)
        at org.codehaus.xfire.transport.http.XFireServletChannel.sendViaServlet(XFireServletChannel.java:69)
        at org.codehaus.xfire.transport.http.XFireServletChannel.send(XFireServletChannel.java:44)
        at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.service.binding.PostInvocationHandler.invoke(PostInvocationHandler.java:36)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
        at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
        at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:304)
        at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:129)
        at org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:595)

        Show
        Ravi Kant Singh added a comment - Hi, Has this issue been fixed? I am still seeing this while returning an array of custom objects (using Xfire 1.2.6). Can someone please suggest a work-around? Thanks, Ravi Exception trace begin: =================== org.codehaus.xfire.handler.DefaultFaultHandler | Fault occurred! javax.xml.stream.XMLStreamException: No open start element, when trying to write end element at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1413) at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1442) at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteEndTag(BaseNsStreamWriter.java:528) at com.ctc.wstx.sw.BaseNsStreamWriter.writeEndElement(BaseNsStreamWriter.java:281) at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:82) at org.codehaus.xfire.util.OutMessageDataSource.createInputStream(OutMessageDataSource.java:92) at org.codehaus.xfire.util.OutMessageDataSource.<init>(OutMessageDataSource.java:37) at org.codehaus.xfire.transport.http.XFireServletChannel.sendViaServlet(XFireServletChannel.java:69) at org.codehaus.xfire.transport.http.XFireServletChannel.send(XFireServletChannel.java:44) at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.service.binding.PostInvocationHandler.invoke(PostInvocationHandler.java:36) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64) at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38) at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:304) at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:129) at org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595)
        Hide
        Alexis Kinsella added a comment -

        You need to correct this bug yourself in XFire source code, no fix version is apparently scheduled. It is easy to correct.
        As a workaround, you can use Apache CXF.

        Show
        Alexis Kinsella added a comment - You need to correct this bug yourself in XFire source code, no fix version is apparently scheduled. It is easy to correct. As a workaround, you can use Apache CXF.
        Hide
        Alexis Kinsella added a comment -

        In File: "\xfire-aegis\src\main\org\codehaus\xfire\aegis\type\basic\ArrayType.java"

        protected void writeValue(Object value,
        MessageWriter writer,
        MessageContext context,
        Type type,
        String name,
        String ns)
        throws XFireFault
        {
        type = AegisBindingProvider.getWriteType(context, value, type);
        MessageWriter cwriter;
        if (type.isWriteOuter())

        { cwriter = writer.getElementWriter(name, ns); }

        else

        { cwriter = writer; }

        if (value==null && type.isNillable())
        cwriter.writeXsiNil();
        else
        type.writeObject( value, cwriter, context );

        if (cwriter != writer)

        { cwriter.close(); }

        }

        Show
        Alexis Kinsella added a comment - In File: "\xfire-aegis\src\main\org\codehaus\xfire\aegis\type\basic\ArrayType.java" protected void writeValue(Object value, MessageWriter writer, MessageContext context, Type type, String name, String ns) throws XFireFault { type = AegisBindingProvider.getWriteType(context, value, type); MessageWriter cwriter; if (type.isWriteOuter()) { cwriter = writer.getElementWriter(name, ns); } else { cwriter = writer; } if (value==null && type.isNillable()) cwriter.writeXsiNil(); else type.writeObject( value, cwriter, context ); if (cwriter != writer) { cwriter.close(); } }

          People

          • Assignee:
            Dan Diephouse
            Reporter:
            Tom Lambrechts
          • Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated: