2 Replies Latest reply on Dec 28, 2009 6:57 AM by Lekan Omotayo

    Invalid byte 2 of 3-byte UTF-8 sequence when sending SOAP over JMS

    Lekan Omotayo Expert

      I am trying to send a SOAP mesage over JMS and I got the following error msg:

       

       

      12:37:55,792 | WARN  | enerContainer-25 | ResolverUtil                     | g.apache.camel.util.ResolverUtil  517 | Could not find class 'org/apache/activemq/camel/converter/ActiveMQConverter.class' in any classloaders: [BundleDelegatingClassLoader for

       

      12:37:56,401 | ERROR | -cxf-se-thread-2 | JBIDispatcherUtil                | e.servicemix.cxfse.CxfSeEndpoint  390 | error preparing message

      javax.xml.transform.TransformerException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.

              at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:756)

       

      12:37:56,401 | ERROR | -cxf-se-thread-2 | CxfSeComponent                   | icemix.common.AsyncBaseLifeCycle  480 | Error processing exchange org.apache.servicemix.jbi.runtime.impl.InOutImpl@c7c991

      java.io.IOException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.

              at org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:164)

       

      here is the xml data sent:

       

                  String req = "";

       

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

                  factory.setNamespaceAware(true);

      byte reqXMLButes[] = req.getBytes();

                  ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(reqXMLButes);

                  

                  DocumentBuilder builder = factory.newDocumentBuilder();

                  Document document = builder.parse(byteArrayInputStream);

      //            Document document = builder.parse( new File("src/NotifyPaymentRequest.xml") );

                  SOAPBody soapBody = soapMessage.getSOAPBody();

                  SOAPBodyElement docElement =  soapBody.addDocument(document);

                  soapMessage.saveChanges();

                  Message m = MessageTransformer.SOAPMessageIntoJMSMessage(soapMessage, sendSession);

                  System.out.println("Display the SOAP message"+m);

                  sender.send(m);

                  

       

      kr.