When deploying CXF service to Karaf it raises "org.apache.cxf.service.factory.ServiceConstructionException: No resource classes found"

Solution Verified - Updated -

Issue

When trying to deploy a CXF based service or Camel route bundle to Karaf, it raises the following error

2019-09-27 11:55:37,165 | ERROR | nt Dispatcher: 1 | BlueprintCamelContext            | 4800 - org.apache.camel.camel-blueprint - 2.17.0.redhat-630371 | Error occurred during starting Camel Context  notifyClaimProcessContext
org.apache.cxf.service.factory.ServiceConstructionException
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:219)[4832:org.apache.cxf.cxf-rt-frontend-jaxrs:3.1.5.redhat-630371]
        at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.createServer(CxfRsConsumer.java:49)[4804:org.apache.camel.camel-cxf:2.17.0.redhat-630371]
        at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:36)[4804:org.apache.camel.camel-cxf:2.17.0.redhat-630371]
        at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:176)[4804:org.apache.camel.camel-cxf:2.17.0.redhat-630371]
        at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:69)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:103)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3472)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3402)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3179)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3035)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:176)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2830)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2826)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2849)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2826)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2795)[4803:org.apache.camel.camel-core:2.17.0.redhat-630371]
        at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:248)[4800:org.apache.camel.camel-blueprint:2.17.0.redhat-630371]
        at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:288)[4800:org.apache.camel.camel-blueprint:2.17.0.redhat-630371]
        at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:181)[4800:org.apache.camel.camel-blueprint:2.17.0.redhat-630371]
        at org.apache.aries.blueprint.container.BlueprintEventDispatcher$4.call(BlueprintEventDispatcher.java:201)[25:org.apache.aries.blueprint.core:1.8.0]
        at org.apache.aries.blueprint.container.BlueprintEventDispatcher$4.call(BlueprintEventDispatcher.java:199)[25:org.apache.aries.blueprint.core:1.8.0]
        at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_151]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[:1.8.0_151]
        at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_151]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)[:1.8.0_151]
        at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_151]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)[:1.8.0_151]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)[:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[:1.8.0_151]
        at java.lang.Thread.run(Unknown Source)[:1.8.0_151]
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: No resource classes found
        at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.checkResources(AbstractJAXRSFactoryBean.java:317)[4832:org.apache.cxf.cxf-rt-frontend-jaxrs:3.1.5.redhat-630371]
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:159)[4832:org.apache.cxf.cxf-rt-frontend-jaxrs:3.1.5.redhat-630371]
        ... 32 more

Environment

  • JBoss Fuse 6.3
  • Karaf runtime
  • CXF based service or Camel route

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content