wsit
  1. wsit
  2. WSIT-1519

com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 2))

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: current
    • Fix Version/s: 2.1
    • Component/s: transaction
    • Labels:
      None
    • Environment:

      Glassfish 3.1 , metro 2.1

      Description

      I have created a sample application with the intention of testing various transaction flow types and transaction attributes for an ejb based web service.

      Webservice implementation is a simple ejb with various operations representing the attributes of transactions.Please find the attached zip file containing the netbeans applications for both service side and client side.

      This is the exception I am seeing at the server side while running the application.

      #|2011-01-13T15:25:59.920+0530|SEVERE|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=83;_ThreadName=Thread-1;|com.sun.xml.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException

      • with linked exception:
        [com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 2))
        at [row,col {unknown-source}]: [1,178]]
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:128)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:93)
        at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:144)
        at $Proxy220.requiresNew(Unknown Source)
        at simple.client.TestServlet.requiresNew(TestServlet.java:137)
        at simple.client.TestServlet.processRequest(TestServlet.java:67)
        at simple.client.TestServlet.doGet(TestServlet.java:95)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:228)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:818)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1008)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:662)
        Caused by: javax.xml.bind.UnmarshalException
        - with linked exception:
        [com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 2))
        at [row,col {unknown-source}

        ]: [1,178]]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:432)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:368)
        at com.sun.xml.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:124)
        at com.sun.xml.bind.api.Bridge.unmarshal(Bridge.java:237)
        at com.sun.xml.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:554)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:125)
        ... 33 more
        Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 2))
        at [row,col

        {unknown-source}

        ]: [1,178]
        at com.ctc.wstx.sr.StreamScanner.throwInvalidSpace(StreamScanner.java:650)
        at com.ctc.wstx.sr.BasicStreamReader.readTextPrimary(BasicStreamReader.java:4554)
        at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2886)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
        at com.sun.xml.ws.util.xml.XMLStreamReaderFilter.next(XMLStreamReaderFilter.java:96)
        at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:197)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:366)
        ... 37 more

        #]
      1. server.log
        39 kB
        Sreekanth

        Activity

        Hide
        Marek Potociar added a comment -

        From the message dump it is obvious that the string sent in the response contains invalid characters. It is because of the way the response String is constructed from the Tx ID bytes. If I truncate the first 8 characters in the response string everything works. Try updating your EJB.java, line 110 like this:

        return new String(xaImpl.getTransactionId()).substring(8);

        I am closing the issue as invalid.

        Marek

        [1]:
        INFO: --[HTTP response - http://localhost:8080/web-service/EJB - 200]--
        INFO: null: HTTP/1.1 200 OK
        INFO: Content-Type: text/xml;charset=utf-8
        INFO: Date: Thu, 13 Jan 2011 14:59:54 GMT
        INFO: server: grizzly/1.9.28
        INFO: Transfer-Encoding: chunked
        INFO: <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:requiresNewResponse xmlns:ns2="http://server.simple/"><return>'€„dhcp-prague08-third-floor-10-163-24-201.cz.ora1681189301</return></ns2:requiresNewResponse></S:Body></S:Envelope>
        INFO: --------------------
        INFO: WSAT4569: Client-side inbound message received
        SEVERE: com.sun.xml.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException

        • with linked exception:
          [com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 2))
          at [row,col {unknown-source}

          ]: [1,178]]
          at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:128)
          at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:93)
          ...

        Show
        Marek Potociar added a comment - From the message dump it is obvious that the string sent in the response contains invalid characters. It is because of the way the response String is constructed from the Tx ID bytes. If I truncate the first 8 characters in the response string everything works. Try updating your EJB.java, line 110 like this: return new String(xaImpl.getTransactionId()).substring(8); I am closing the issue as invalid. Marek [1] : INFO: -- [HTTP response - http://localhost:8080/web-service/EJB - 200] -- INFO: null: HTTP/1.1 200 OK INFO: Content-Type: text/xml;charset=utf-8 INFO: Date: Thu, 13 Jan 2011 14:59:54 GMT INFO: server: grizzly/1.9.28 INFO: Transfer-Encoding: chunked INFO: <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:requiresNewResponse xmlns:ns2="http://server.simple/"><return>'€„dhcp-prague08-third-floor-10-163-24-201.cz.ora1681189301</return></ns2:requiresNewResponse></S:Body></S:Envelope> INFO: -------------------- INFO: WSAT4569: Client-side inbound message received SEVERE: com.sun.xml.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException with linked exception: [com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 2)) at [row,col {unknown-source} ]: [1,178] ] at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:128) at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:93) ...

          People

          • Assignee:
            paul_parkinson
            Reporter:
            Sreekanth
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: