2 Replies Latest reply on May 4, 2010 11:28 AM by suxuguang

    javax.xml.stream.XMLStreamException: Trying to declare prefix xmlns

    suxuguang

      Hi,

        I was using the 3.4.0.5 ESB to send a notification out through CXF provider. The same notify message had no problem in 3.4.0.1, but in 3.4.0.5, I got this error: "javax.xml.stream.XMLStreamException: Trying to declare prefix xmlns (illegal as per NS 1.1 #4)". This is how the outgoing message look like:

      "

      <?xml version="1.0" encoding="UTF-8"?>

      <soap:Body>

          <ns2:Notify xmlns="http://www.w3.org/2005/08/addressing"

              xmlns:ns2="http://docs.oasis-open.org/wsn/b-2"

              xmlns:ns3="http://docs.oasis-open.org/wsrf/bf-2"

              xmlns:ns4="http://docs.oasis-open.org/wsrf/rp-2" xmlns:ns5="http://docs.oasis-open.org/wsn/t-1">

              <ns2:NotificationMessage>

                  <ns2:Topic Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">ABC</ns2:Topic>

                  <ns2:Message/>

              </ns2:NotificationMessage>

          </ns2:Notify>

      </soap:Body>

      "

      The error look like this:

      "

      org.apache.cxf.binding.soap.SoapFault: Problem writing SAAJ model to stream

           at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:206)

           at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:162)

      ......

      .....

      Caused by: javax.xml.stream.XMLStreamException: Trying to declare prefix xmlns (illegal as per NS 1.1 #4)

           at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1547)

           at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1554)

           at com.ctc.wstx.sw.BaseNsStreamWriter.setPrefix(BaseNsStreamWriter.java:184)

      "

       

      Would anyone know what caould be the cause?

       

      Thanks for your help!