javax.xml.stream.XMLStreamException: Can not create StAX reader for the Source passed -- neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams)

Spring JIRA | Tareq Abedrabbo | 1 decade ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    I'm trying to create a javax.xml.stream.XMLStreamReader from WebServiceMessage.getPayloadSource(). I'm using Axiom to create web service messages and Woodstox as a StaX parser. The following code is throwing the following exception with Axiom but works fine with Saaj: javax.xml.stream.XMLStreamException: Can not create StAX reader for the Source passed -- neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams) XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader parser = inputFactory.createXMLStreamReader(message.getPayloadSource()); To reproduce the exception, modify the echo sample as follows: 1- Add Axiom jars to the classpath 2- Add Woodstox to the classpath 3- Add <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"/> to spring-ws-servlet.xml 4- Add the following endpoint interceptor: package org.springframework.ws.samples.echo.ws; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamReader; import org.springframework.ws.WebServiceMessage; import org.springframework.ws.context.MessageContext; import org.springframework.ws.server.EndpointInterceptor; public class StaxEndpointInterceptor implements EndpointInterceptor { public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception { WebServiceMessage message = messageContext.getRequest(); XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader parser = inputFactory.createXMLStreamReader(message.getPayloadSource()); return true; } public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { return true; } } 5 - configure it in spring-ws-servlet.xml: <bean id="staxEndpointInterceptor" class="org.springframework.ws.samples.echo.ws.StaxEndpointInterceptor"/> and <ref local="staxEndpointInterceptor"/> Calling echo now will throw the following exception: javax.xml.stream.XMLStreamException: Can not create StAX reader for the Source passed -- neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams) at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:756) at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:329) at org.springframework.ws.samples.echo.ws.StaxEndpointInterceptor.handleRequest(StaxEndpointInterceptor.java:16) at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:197) at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:166) at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handle(WebServiceMessageReceiverObjectSupport.java:78) at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:60) at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:125) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:360) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) 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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source)

    Spring JIRA | 1 decade ago | Tareq Abedrabbo
    javax.xml.stream.XMLStreamException: Can not create StAX reader for the Source passed -- neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams)
  2. 0

    I'm trying to create a javax.xml.stream.XMLStreamReader from WebServiceMessage.getPayloadSource(). I'm using Axiom to create web service messages and Woodstox as a StaX parser. The following code is throwing the following exception with Axiom but works fine with Saaj: javax.xml.stream.XMLStreamException: Can not create StAX reader for the Source passed -- neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams) XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader parser = inputFactory.createXMLStreamReader(message.getPayloadSource()); To reproduce the exception, modify the echo sample as follows: 1- Add Axiom jars to the classpath 2- Add Woodstox to the classpath 3- Add <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"/> to spring-ws-servlet.xml 4- Add the following endpoint interceptor: package org.springframework.ws.samples.echo.ws; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamReader; import org.springframework.ws.WebServiceMessage; import org.springframework.ws.context.MessageContext; import org.springframework.ws.server.EndpointInterceptor; public class StaxEndpointInterceptor implements EndpointInterceptor { public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception { WebServiceMessage message = messageContext.getRequest(); XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader parser = inputFactory.createXMLStreamReader(message.getPayloadSource()); return true; } public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception { return true; } } 5 - configure it in spring-ws-servlet.xml: <bean id="staxEndpointInterceptor" class="org.springframework.ws.samples.echo.ws.StaxEndpointInterceptor"/> and <ref local="staxEndpointInterceptor"/> Calling echo now will throw the following exception: javax.xml.stream.XMLStreamException: Can not create StAX reader for the Source passed -- neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams) at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:756) at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:329) at org.springframework.ws.samples.echo.ws.StaxEndpointInterceptor.handleRequest(StaxEndpointInterceptor.java:16) at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:197) at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:166) at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handle(WebServiceMessageReceiverObjectSupport.java:78) at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:60) at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:125) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:360) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) 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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source)

    Spring JIRA | 1 decade ago | Tareq Abedrabbo
    javax.xml.stream.XMLStreamException: Can not create StAX reader for the Source passed -- neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams)
  3. 0

    WMS not working (build worldwind-0.6.485.13403) 27-05-2010

    worldwindcentral.com | 2 years ago
    javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,2] Message: The markup in the document following the root element must be well-formed. at com.sun.org.apache.xerces.internal.impl. XMLStreamReaderImpl.next(XMLStreamReader Impl.java:593) at com.sun.xml.internal.stream.XMLEventRead erImpl.nextEvent(XMLEventReaderImpl.java :85) at gov.nasa.worldwind.util.xml.BasicXMLEven tParserContext.nextEvent(Unknown Source) at gov.nasa.worldwind.ogc.OGCCapabilities.p arse(Unknown Source) [catch] at gov.nasa.worldwind.ogc.wms.WMSCapabiliti es.parse(Unknown Source) at gov.nasa.worldwind.util.SessionCacheUtil s.parseCapabilities(Unknown Source) at gov.nasa.worldwind.util.SessionCacheUtil s.getSessionCapabilities(Unknown Source) at gov.nasa.worldwind.util.SessionCacheUtil s.getOrRetrieveSessionCapabilities(Unkno wn Source) at gov.nasa.worldwind.layers.BasicTiledImag eLayer.retrieveResources(Unknown Source) at gov.nasa.worldwind.layers.BasicTiledImag eLayer$ResourceRetrievalTask.retrieveRes ources(Unknown Source) at gov.nasa.worldwind.layers.BasicTiledImag eLayer$ResourceRetrievalTask.run(Unknown Source) at java.util.concurrent.Executors$RunnableA dapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.inn erRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndRe set(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPool Executor$ScheduledFutureTask.access$101( ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPool Executor$ScheduledFutureTask.runPeriodic (ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPool Executor$ScheduledFutureTask.run(Schedul edThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$ Worker.runTask(ThreadPoolExecutor.java:8 86) at java.util.concurrent.ThreadPoolExecutor$ Worker.run(ThreadPoolExecutor.java:908)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.xml.stream.XMLStreamException

      Can not create StAX reader for the Source passed -- neither reader, input stream nor system id was accessible; can not use other types of sources (like embedded SAX streams)

      at com.ctc.wstx.stax.WstxInputFactory.createSR()
    2. Woodstox
      WstxInputFactory.createXMLStreamReader
      1. com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:756)
      2. com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:329)
      2 frames
    3. org.springframework.ws
      StaxEndpointInterceptor.handleRequest
      1. org.springframework.ws.samples.echo.ws.StaxEndpointInterceptor.handleRequest(StaxEndpointInterceptor.java:16)
      1 frame
    4. Spring WS Core
      MessageDispatcherServlet.doService
      1. org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:197)
      2. org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:166)
      3. org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handle(WebServiceMessageReceiverObjectSupport.java:78)
      4. org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:60)
      5. org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:125)
      5 frames
    5. Spring MVC
      FrameworkServlet.doPost
      1. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
      2. org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:360)
      2 frames
    6. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      2 frames
    7. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      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)
      5. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      6. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      7. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      8. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      8 frames
    8. Grizzly HTTP
      LeaderFollowerWorkerThread.runIt
      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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      4 frames
    9. Tomcat Util
      ThreadPool$ControlRunnable.run
      1. org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      1 frame
    10. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)
      1 frame