[
https://issues.apache.org/jira/browse/ARIES-1965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17024519#comment-17024519
]
Carlos Sierra Andrés commented on ARIES-1965:
---------------------------------------------
hey [~maggu2810],
that's the point. It is not changing the defaults, as far as I know at least.
The problem can be that the HTTP (in this case) Whiteboard is setting the
application bundle as the Thread Context Class Loader and thus altering the
java SPI resolution.
If the problem is solved by forcing a specific input and output for the factory
it might be your bundle is not finding the proper SPI interface implementation?
Carlos.
> XMLInputFactory gets broken
> ---------------------------
>
> Key: ARIES-1965
> URL: https://issues.apache.org/jira/browse/ARIES-1965
> Project: Aries
> Issue Type: Bug
> Components: jax-rs-whiteboard
> Affects Versions: jax-rs-whiteboard-1.0.5
> Reporter: Markus Rathgeb
> Priority: Major
>
> In my code I used the following line:
> {code:java}
> final XMLInputFactory inputFactory = XMLInputFactory.newInstance();{code}
> After adding the Aires JAX-RS Whiteboard this does not work anymore but
> raises a service configuration error.
> {noformat}
> java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory:
> Provider com.ctc.wstx.stax.WstxInputFactory not found
> at java.util.ServiceLoader.fail(ServiceLoader.java:239)
> at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
> at
> java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
> at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
> at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
> at
> javax.xml.stream.$FactoryFinder.lambda$findServiceProvider$3($FactoryFinder.java:186)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.xml.stream.$FactoryFinder.findServiceProvider($FactoryFinder.java:181)
> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:164)
> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:106)
> at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:66)
> at ... custom code ...
> at ... custom code ...
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:695)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
> at
> org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:226)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1591)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
> at
> org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:772)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
> at org.eclipse.jetty.server.Server.handle(Server.java:494)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)
> at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)
> at
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
> at
> org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:426)
> at
> org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:320)
> at
> org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:158)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
> at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
> at
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
> at
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
> at
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
> at
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
> at
> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)
> at java.lang.Thread.run(Thread.java:748){noformat}
> I checked the classes of all bundles in the runtime which one contains
> com.ctc.wstx.stax.... ones.
> It is the one with BSN "org.apache.aries.jax.rs.whiteboard".
>
> So, I am assume some bundled stuff in your code base changes the default XML
> event factory.
> But perhaps not correctly because the provider is not found.
>
> I does not expect that the default XML providers are touched by such an
> specification implementation at all, but I assume no one cares as long as it
> is still working.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)