5 Replies Latest reply on Apr 10, 2006 6:25 PM by Thomas Diesler

    jbossws - Invalid byte 2 of 2-byte UTF-8 sequence

    Anders Hedstrom Novice

      Hi,

      I consume a external web service and when I use jboss-ws4ee soap stack it works fine, but when a switch to jbossws soap stack I get the following exception: Invalid byte 2 of 2-byte UTF-8 sequence

      When I look att the data received from the web service I can find one sequence of characters that I guess causes this exception,

      <soap:body>
      ...
       <city>MALM&_#_x_D_6;</city>
      

      (&_#_x_D_6; -> I've added the underscores, otherwise this forum transalated it to the correct character, Ö, so the underscores isn't present in the actual soap message...)

      This character (&_#_x_D_6;) is the swedish character 'Ö' that the provider of the web service has encoded this way. Is this an invalid encoding? It passes thru the ws4ee soap stack but not the jbossws soapstack...

      Here's the stack trace

      2006-03-17 08:52:05,960 ERROR [STDERR] javax.xml.soap.SOAPException: Could not transmit message
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:162)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:66)
      2006-03-17 08:52:05,960 ERROR [STDERR] at test.ejb3.WsClientEJB.callWS(WsClientEJB.java:300)
      2006-03-17 08:52:05,960 ERROR [STDERR] at test.ejb3.WsClientEJB.testInvoice(WsClientEJB.java:266)
      2006-03-17 08:52:05,960 ERROR [STDERR] at test.ejb3.WsClientEJB.testLOS(WsClientEJB.java:228)
      2006-03-17 08:52:05,960 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2006-03-17 08:52:05,960 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2006-03-17 08:52:05,960 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2006-03-17 08:52:05,960 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:192)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:219)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:660)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:513)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:290)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:344)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:202)
      2006-03-17 08:52:05,960 ERROR [STDERR] Caused by: javax.xml.rpc.JAXRPCException: java.io.IOException: org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.ws.soap.SOAPContentElement.expandToDOM(SOAPContentElement.java:893)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.ws.soap.SOAPContentElement.getChildNodes(SOAPContentElement.java:761)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.util.xml.DOMWriter.printInternal(DOMWriter.java:166)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.util.xml.DOMWriter.printInternal(DOMWriter.java:225)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.util.xml.DOMWriter.printInternal(DOMWriter.java:225)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.util.xml.DOMWriter.printInternal(DOMWriter.java:225)
      2006-03-17 08:52:05,960 ERROR [STDERR] at org.jboss.util.xml.DOMWriter.print(DOMWriter.java:144)
      2006-03-17 08:52:05,970 ERROR [STDERR] at org.jboss.util.xml.DOMWriter.printNode(DOMWriter.java:93)
      2006-03-17 08:52:05,970 ERROR [STDERR] at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:154)
      2006-03-17 08:52:05,970 ERROR [STDERR] ... 32 more
      2006-03-17 08:52:05,970 ERROR [STDERR] Caused by: java.io.IOException: org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.
      2006-03-17 08:52:05,970 ERROR [STDERR] at org.jboss.util.xml.DOMUtils.parse(DOMUtils.java:117)
      2006-03-17 08:52:05,970 ERROR [STDERR] at org.jboss.util.xml.DOMUtils.parse(DOMUtils.java:96)
      2006-03-17 08:52:05,970 ERROR [STDERR] at org.jboss.ws.soap.SOAPContentElement.expandToDOM(SOAPContentElement.java:849)
      2006-03-17 08:52:05,970 ERROR [STDERR] ... 40 more
      2006-03-17 08:52:05,970 ERROR [test.ejb3.WsClientEJB] javax.xml.soap.SOAPException: Could not transmit message
      


      Cheers
      Anders