Hello,

I’m trying to upgrade our application to use more recent versions of Karaf and 
CXF.  Our app is currently running using Karaf 4.2.1 and CXF 3.2.6 running 
under JRE 1.8.0_102.  But when I hit rest endpoints, I get an exception.

Below are the cxf features/bundles I’ve got installed:
<feature version="${cxf.version}">cxf</feature>
<feature version="${cxf.version}">cxf-rs-security-cors</feature>
<feature version="${cxf.version}">cxf-rs-description-swagger2</feature>
<bundle>mvn:org.apache.cxf/cxf-rt-rs-security-cors/${cxf.version}</bundle>

Based on the following stacktrace, it seems like the woodstox engine isn’t 
registered correctly with the JVM:

javax.xml.stream.FactoryConfigurationError: Provider for class 
javax.xml.stream.XMLOutputFactory cannot be created
        at 
javax.xml.stream.$FactoryFinder.findServiceProvider($FactoryFinder.java:193) 
~[?:?]
        at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:164) ~[?:?]
        at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:106) ~[?:?]
        at 
javax.xml.stream.XMLOutputFactory.newInstance(XMLOutputFactory.java:37) ~[?:?]
        at 
org.apache.cxf.staxutils.StaxUtils.getXMLOutputFactory(StaxUtils.java:295) 
~[?:?]
        at 
org.apache.cxf.staxutils.StaxUtils.createXMLStreamWriter(StaxUtils.java:410) 
~[?:?]
        at 
org.apache.cxf.interceptor.StaxOutInterceptor.handleMessage(StaxOutInterceptor.java:82)
 ~[?:?]
        at 
org.apache.cxf.jaxrs.interceptor.JAXRSDefaultFaultOutInterceptor.handleMessage(JAXRSDefaultFaultOutInterceptor.java:77)
 ~[?:?]
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
 ~[?:?]
        at 
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:112)
 ~[?:?]
        at 
org.apache.cxf.phase.PhaseInterceptorChain.wrapExceptionAsFault(PhaseInterceptorChain.java:374)
 ~[?:?]
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:332)
 ~[?:?]
        at 
org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:90)
 ~[?:?]
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
 ~[?:?]
        at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
 ~[?:?]
        at 
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
 ~[?:?]
        at 
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
 ~[?:?]
        at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
 ~[?:?]
        at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
 ~[?:?]
        at 
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216)
 ~[?:?]
        at 
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301)
 ~[?:?]
        at 
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:225)
 ~[?:?]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) 
~[243:javax.servlet-api:3.1.0]
        at 
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276)
 ~[?:?]
        at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865) ~[?:?]
        at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535) 
~[?:?]
        at 
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
 ~[?:?]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) 
~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) 
~[?:?]
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) 
~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
 ~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
 ~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
 ~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
 ~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
 ~[?:?]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
 ~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) ~[?:?]
        at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
 ~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
 ~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
 ~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) 
~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
 ~[?:?]
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) 
~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at org.eclipse.jetty.server.Server.handle(Server.java:531) 
~[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352) 
[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) 
[414:org.eclipse.jetty.server:9.4.11.v20180605]
        at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
 [406:org.eclipse.jetty.io:9.4.11.v20180605]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) 
[406:org.eclipse.jetty.io:9.4.11.v20180605]
        at 
org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:291) 
[406:org.eclipse.jetty.io:9.4.11.v20180605]
        at 
org.eclipse.jetty.io.ssl.SslConnection$3.succeeded(SslConnection.java:151) 
[406:org.eclipse.jetty.io:9.4.11.v20180605]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) 
[406:org.eclipse.jetty.io:9.4.11.v20180605]
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) 
[406:org.eclipse.jetty.io:9.4.11.v20180605]
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
 [417:org.eclipse.jetty.util:9.4.11.v20180605]
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
 [417:org.eclipse.jetty.util:9.4.11.v20180605]
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
 [417:org.eclipse.jetty.util:9.4.11.v20180605]
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
 [417:org.eclipse.jetty.util:9.4.11.v20180605]
        at 
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
 [417:org.eclipse.jetty.util:9.4.11.v20180605]
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
 [417:org.eclipse.jetty.util:9.4.11.v20180605]
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680) 
[417:org.eclipse.jetty.util:9.4.11.v20180605]
        at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: java.lang.RuntimeException: Provider for class 
javax.xml.stream.XMLOutputFactory cannot be created
        at 
javax.xml.stream.$FactoryFinder.findServiceProvider($FactoryFinder.java:192) 
~[?:?]
        ... 59 more
Caused by: java.util.ServiceConfigurationError: 
javax.xml.stream.XMLOutputFactory: Provider com.ctc.wstx.stax.WstxOutputFactory 
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) 
~[?:?]
        ... 59 more

Is there something I’m missing from my configuration?  Is there a jar file I 
need to put in the endorsed directory?


--
Javer Delgadillo | Realtime GIS Engineer/ScrumMaster
Esri | 380 New York St | Redlands, CA 92373 | USA
T 909 793 2853 x1068 | [email protected] | esri.com

THE
SCIENCE
OF
WHERE™

Reply via email to