org.apache.cxf.interceptor.Fault: Could not create XMLStreamReader (input was of encoding {0}).

MuleSoft JIRA | Fabian Lange | 7 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When upgrading Java on a machine running CXF Transport with mule the Encoding gets broken. The Exception is: {code} 15:10:52,309 ERROR [STDERR] Nov 25, 2009 3:10:52 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not create XMLStreamReader (input was of encoding {0}). at org.apache.cxf.interceptor.StaxOutInterceptor.handleMessage(StaxOutInterceptor.java:74) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220) at org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:198) at org.mule.transport.cxf.CxfServiceComponent$1.write(CxfServiceComponent.java:271) at org.mule.transport.servlet.AbstractReceiverServlet.writeResponse(AbstractReceiverServlet.java:191) at org.mule.transport.servlet.MuleReceiverServlet.doPost(MuleReceiverServlet.java:191) 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:619) Caused by: javax.xml.stream.XMLStreamException: java.io.UnsupportedEncodingException: "utf-8" at com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:257) at com.ctc.wstx.stax.WstxOutputFactory.createXMLStreamWriter(WstxOutputFactory.java:124) at org.apache.cxf.interceptor.StaxOutInterceptor.handleMessage(StaxOutInterceptor.java:67) ... 25 more Caused by: java.io.UnsupportedEncodingException: "utf-8" at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:42) at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:83) at com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:253) ... 27 more {code} Which looks strange, but in fact the Encoding is ""utf-8"" when "utf-8" was expected. Somewhere the enclosing quotes sneaked in with the java version upgrade. Here a Mule Event from 1.6.06: {code} {MULE_EVENT=MuleEvent: e8b9f602-9c88-11de-9ab5-43f36b7c80ec, sync=true, stop processing=false, org.mule.endpoint.DynamicURIInboundEndpoint@55116481, mule.message=org.mule.transport.servlet.HttpRequestMessageAdapter/org.mule.transport.servlet.HttpRequestMessageAdapter@166caf0{id=eae3b3d5-9c88-11de-9ab5-43f36b7c80ec, payload=org.apache.catalina.connector.CoyoteInputStream, properties=Properties{invocation:{}, inbound:{content-type=text/xml; charset=utf-8, connection=keep-alive, soapaction="", Host=localhost:8080, accept=text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2, content-length=831, user-agent=Java/1.6.0_06}, outbound:{http.request=/foo/bar/service, http.context.path=/foo/bar/service, MULE_ENCODING=utf-8, http.method=POST, http.request.path=/foo/bar/service, MULE_REMOTE_SYNC=true, MULE_ORIGINATING_ENDPOINT=servlet:ServiceControllerImplPort}, session:{}, }, correlationId=null, correlationGroup=-1, correlationSeq=-1, encoding=utf-8, exceptionPayload=null}, org.apache.cxf.transport.Destination=org.mule.transport.cxf.transport.MuleUniversalDestination@1a8c8c9, SOAPAction=null, org.apache.cxf.transport.local.LocalConduit.directDispatch=true, org.apache.cxf.message.Message.HTTP_REQUEST_METHOD=POST, Content-Type=text/xml, org.apache.cxf.message.Message.ENCODING=utf-8, org.apache.cxf.message.Message.BASE_PATH=/foo/bar/service, org.apache.cxf.message.Message.PATH_INFO=/foo/bar/service} {code} What you can see is: user-agent=Java/1.6.0_06 and MULE_ENCODING=utf-8 the same request to 1.6.0.16 {code} {MULE_EVENT=MuleEvent: 513d4039-9c87-11de-a654-e750bf59dcd3, sync=true, stop processing=false, org.mule.endpoint.DynamicURIInboundEndpoint@a17031d2, mule.message=org.mule.transport.servlet.HttpRequestMessageAdapter/org.mule.transport.servlet.HttpRequestMessageAdapter@c987f5{id=76c91bd2-9c88-11de-a654-e750bf59dcd3, payload=org.apache.catalina.connector.CoyoteInputStream, properties=Properties{invocation:{}, inbound:{content-type=text/xml;charset="utf-8", connection=keep-alive, soapaction="", Host=localhost:8080, accept=text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2, content-length=831, user-agent=JAX-WS RI 2.1.6 in JDK 6}, outbound:{http.request=/foo/bar/service, http.context.path=/foo/bar/service, MULE_ENCODING="utf-8", http.method=POST, http.request.path=/foo/bar/service, MULE_REMOTE_SYNC=true, MULE_ORIGINATING_ENDPOINT=servlet:ServiceControllerImplPort}, session:{}, }, correlationId=null, correlationGroup=-1, correlationSeq=-1, encoding="utf-8", exceptionPayload=null}, org.apache.cxf.transport.Destination=org.mule.transport.cxf.transport.MuleUniversalDestination@19554f9, SOAPAction=null, org.apache.cxf.transport.local.LocalConduit.directDispatch=true, org.apache.cxf.message.Message.HTTP_REQUEST_METHOD=POST, Content-Type=text/xml, org.apache.cxf.message.Message.ENCODING="utf-8", org.apache.cxf.message.Message.BASE_PATH=/foo/bar/service, org.apache.cxf.message.Message.PATH_INFO=/foo/bar/service} {code} Here: user-agent=JAX-WS RI 2.1.6 in JDK 6 and MULE_ENCODING="utf-8 either Mule needs to be fixed (but i dont know where and why, because this seems to be related to the message handling) or it is a jdk bug

    MuleSoft JIRA | 7 years ago | Fabian Lange
    org.apache.cxf.interceptor.Fault: Could not create XMLStreamReader (input was of encoding {0}).
  2. 0

    When upgrading Java on a machine running CXF Transport with mule the Encoding gets broken. The Exception is: {code} 15:10:52,309 ERROR [STDERR] Nov 25, 2009 3:10:52 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not create XMLStreamReader (input was of encoding {0}). at org.apache.cxf.interceptor.StaxOutInterceptor.handleMessage(StaxOutInterceptor.java:74) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220) at org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:198) at org.mule.transport.cxf.CxfServiceComponent$1.write(CxfServiceComponent.java:271) at org.mule.transport.servlet.AbstractReceiverServlet.writeResponse(AbstractReceiverServlet.java:191) at org.mule.transport.servlet.MuleReceiverServlet.doPost(MuleReceiverServlet.java:191) 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:619) Caused by: javax.xml.stream.XMLStreamException: java.io.UnsupportedEncodingException: "utf-8" at com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:257) at com.ctc.wstx.stax.WstxOutputFactory.createXMLStreamWriter(WstxOutputFactory.java:124) at org.apache.cxf.interceptor.StaxOutInterceptor.handleMessage(StaxOutInterceptor.java:67) ... 25 more Caused by: java.io.UnsupportedEncodingException: "utf-8" at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:42) at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:83) at com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:253) ... 27 more {code} Which looks strange, but in fact the Encoding is ""utf-8"" when "utf-8" was expected. Somewhere the enclosing quotes sneaked in with the java version upgrade. Here a Mule Event from 1.6.06: {code} {MULE_EVENT=MuleEvent: e8b9f602-9c88-11de-9ab5-43f36b7c80ec, sync=true, stop processing=false, org.mule.endpoint.DynamicURIInboundEndpoint@55116481, mule.message=org.mule.transport.servlet.HttpRequestMessageAdapter/org.mule.transport.servlet.HttpRequestMessageAdapter@166caf0{id=eae3b3d5-9c88-11de-9ab5-43f36b7c80ec, payload=org.apache.catalina.connector.CoyoteInputStream, properties=Properties{invocation:{}, inbound:{content-type=text/xml; charset=utf-8, connection=keep-alive, soapaction="", Host=localhost:8080, accept=text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2, content-length=831, user-agent=Java/1.6.0_06}, outbound:{http.request=/foo/bar/service, http.context.path=/foo/bar/service, MULE_ENCODING=utf-8, http.method=POST, http.request.path=/foo/bar/service, MULE_REMOTE_SYNC=true, MULE_ORIGINATING_ENDPOINT=servlet:ServiceControllerImplPort}, session:{}, }, correlationId=null, correlationGroup=-1, correlationSeq=-1, encoding=utf-8, exceptionPayload=null}, org.apache.cxf.transport.Destination=org.mule.transport.cxf.transport.MuleUniversalDestination@1a8c8c9, SOAPAction=null, org.apache.cxf.transport.local.LocalConduit.directDispatch=true, org.apache.cxf.message.Message.HTTP_REQUEST_METHOD=POST, Content-Type=text/xml, org.apache.cxf.message.Message.ENCODING=utf-8, org.apache.cxf.message.Message.BASE_PATH=/foo/bar/service, org.apache.cxf.message.Message.PATH_INFO=/foo/bar/service} {code} What you can see is: user-agent=Java/1.6.0_06 and MULE_ENCODING=utf-8 the same request to 1.6.0.16 {code} {MULE_EVENT=MuleEvent: 513d4039-9c87-11de-a654-e750bf59dcd3, sync=true, stop processing=false, org.mule.endpoint.DynamicURIInboundEndpoint@a17031d2, mule.message=org.mule.transport.servlet.HttpRequestMessageAdapter/org.mule.transport.servlet.HttpRequestMessageAdapter@c987f5{id=76c91bd2-9c88-11de-a654-e750bf59dcd3, payload=org.apache.catalina.connector.CoyoteInputStream, properties=Properties{invocation:{}, inbound:{content-type=text/xml;charset="utf-8", connection=keep-alive, soapaction="", Host=localhost:8080, accept=text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2, content-length=831, user-agent=JAX-WS RI 2.1.6 in JDK 6}, outbound:{http.request=/foo/bar/service, http.context.path=/foo/bar/service, MULE_ENCODING="utf-8", http.method=POST, http.request.path=/foo/bar/service, MULE_REMOTE_SYNC=true, MULE_ORIGINATING_ENDPOINT=servlet:ServiceControllerImplPort}, session:{}, }, correlationId=null, correlationGroup=-1, correlationSeq=-1, encoding="utf-8", exceptionPayload=null}, org.apache.cxf.transport.Destination=org.mule.transport.cxf.transport.MuleUniversalDestination@19554f9, SOAPAction=null, org.apache.cxf.transport.local.LocalConduit.directDispatch=true, org.apache.cxf.message.Message.HTTP_REQUEST_METHOD=POST, Content-Type=text/xml, org.apache.cxf.message.Message.ENCODING="utf-8", org.apache.cxf.message.Message.BASE_PATH=/foo/bar/service, org.apache.cxf.message.Message.PATH_INFO=/foo/bar/service} {code} Here: user-agent=JAX-WS RI 2.1.6 in JDK 6 and MULE_ENCODING="utf-8 either Mule needs to be fixed (but i dont know where and why, because this seems to be related to the message handling) or it is a jdk bug

    MuleSoft JIRA | 7 years ago | Fabian Lange
    org.apache.cxf.interceptor.Fault: Could not create XMLStreamReader (input was of encoding {0}).
  3. 0

    java.io.UnsupportedEncodingException

    GitHub | 4 years ago | LordOfTheRams
    java.lang.ExceptionInInitializerError
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [KARAF-3327] Incorrect LC_CTYPE parsing - ASF JIRA

    apache.org | 2 years ago
    java.lang.RuntimeException: Error opening console reader
  6. 0

    sbt: java.io.UnsupportedEncodingException: UTF-8"

    GitHub | 1 year ago | xiwenc
    java.io.UnsupportedEncodingException: UTF-8"

    Root Cause Analysis

    1. java.io.UnsupportedEncodingException

      "utf-8"

      at sun.nio.cs.StreamEncoder.forOutputStreamWriter()
    2. Java RT
      OutputStreamWriter.<init>
      1. sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:42)
      2. java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:83)
      2 frames
    3. Woodstox
      WstxOutputFactory.createXMLStreamWriter
      1. com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:253)
      2. com.ctc.wstx.stax.WstxOutputFactory.createXMLStreamWriter(WstxOutputFactory.java:124)
      2 frames
    4. Apache CXF Core
      PhaseInterceptorChain.resume
      1. org.apache.cxf.interceptor.StaxOutInterceptor.handleMessage(StaxOutInterceptor.java:67)
      2. org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
      3. org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:198)
      3 frames
    5. org.mule.transport
      CxfServiceComponent$1.write
      1. org.mule.transport.cxf.CxfServiceComponent$1.write(CxfServiceComponent.java:271)
      1 frame
    6. Servlet Transport
      MuleReceiverServlet.doPost
      1. org.mule.transport.servlet.AbstractReceiverServlet.writeResponse(AbstractReceiverServlet.java:191)
      2. org.mule.transport.servlet.MuleReceiverServlet.doPost(MuleReceiverServlet.java:191)
      2 frames
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      2 frames
    8. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2 frames
    9. JBoss Application Server Tomcat
      ReplyHeaderFilter.doFilter
      1. org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      1 frame
    10. Glassfish Core
      StandardContextValve.invoke
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      4 frames
    11. JBoss Application Server Tomcat
      JaccContextValve.invoke
      1. org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      2. org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      2 frames
    12. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      2. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      3. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      4. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      4 frames
    13. Grizzly HTTP
      MasterSlaveWorkerThread.run
      1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      2. org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      3. org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      4. org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      4 frames
    14. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:619)
      1 frame