Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4571

javax.ws.rs.WebApplicationException when creating jaxrs:server under OSGi Blueprint

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7.1
    • Component/s: JAX-RS, OSGi
    • Labels:
      None
    • Environment:
    • Estimated Complexity:
      Unknown

      Description

      A relatively straightforward server:

      <jaxrs:server id="requireServer" address="/require">
      	<jaxrs:serviceBeans>
      		<bean class="org.soluvas.web.backbone.RequireResource">
      			<argument ref="jsModules"/>
      			<argument ref="jsShims"/>
      		</bean>
      	</jaxrs:serviceBeans>
      </jaxrs:server>
      

      throws error like below.

      Sample stacktrace:

      2012-10-16 16:06:19,498 | ERROR | rint Extender: 2 | BlueprintContainerImpl           | container.BlueprintContainerImpl  375 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Unable to start blueprint container for bundle org.soluvas.web.backbone
      org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to intialize bean requireServer
              at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:714)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7:org.apache.aries.blueprint.core:1.0.1]
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_07]
              at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_07]
              at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:646)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:353)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:252)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[7:org.apache.aries.blueprint.core:1.0.1]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_07]
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_07]
              at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_07]
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_07]
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_07]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.7.0_07]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.7.0_07]
              at java.lang.Thread.run(Thread.java:722)[:1.7.0_07]
      Caused by: org.apache.cxf.service.factory.ServiceConstructionException
              at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:201)
              at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.init(JAXRSServerFactoryBean.java:131)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_07]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_07]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_07]
              at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_07]
              at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[7:org.apache.aries.blueprint.core:1.0.1]
              ... 20 more
      Caused by: javax.ws.rs.WebApplicationException
              at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.checkResources(AbstractJAXRSFactoryBean.java:315)
              at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:148)
              ... 28 more
      

      Another error stacktrace:

      2012-10-16 15:59:01,064 | ERROR | rint Extender: 3 | BlueprintContainerImpl           | container.BlueprintContainerImpl  375 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Unable to start blueprint container for bundle id.co.bippo.app
      org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to intialize bean .component-2
              at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:714)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7:org.apache.aries.blueprint.core:1.0.1]
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_07]
              at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_07]
              at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:646)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:353)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:252)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[7:org.apache.aries.blueprint.core:1.0.1]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_07]
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_07]
              at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_07]
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_07]
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_07]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.7.0_07]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.7.0_07]
              at java.lang.Thread.run(Thread.java:722)[:1.7.0_07]
      Caused by: org.apache.cxf.service.factory.ServiceConstructionException
              at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:201)
              at com.soluvas.cxf.DynamicJaxrsManager.createServer(DynamicJaxrsManager.java:66)
              at com.soluvas.cxf.DynamicJaxrsManager.addingService(DynamicJaxrsManager.java:92)
              at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf.jar:2.3.0]
              at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)[karaf.jar:2.3.0]
              at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf.jar:2.3.0]
              at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf.jar:2.3.0]
              at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf.jar:2.3.0]
              at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf.jar:2.3.0]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_07]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_07]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_07]
              at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_07]
              at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[7:org.apache.aries.blueprint.core:1.0.1]
              ... 20 more
      Caused by: javax.ws.rs.WebApplicationException
              at org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.checkResources(AbstractJAXRSFactoryBean.java:315)
              at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:148)
              ... 35 more
      
      

      This error didn't happen in 2.6.2. Or at least didn't happen often.

      All CXF bundles are active:

      [2017] [Active     ] [Created     ] [       ] [   40] Apache CXF API (2.7.0)
      [2018] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime Core (2.7.0)
      [2019] [Active     ] [            ] [       ] [   40] Apache CXF Runtime Management (2.7.0)
      [2020] [Active     ] [Created     ] [       ] [   40] Apache CXF Karaf Commands (2.7.0)
      [2021] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime HTTP Transport (2.7.0)
      [2133] [Active     ] [            ] [       ] [   40] Apache CXF Runtime XML Binding (2.7.0)
      [2134] [Active     ] [            ] [       ] [   40] Apache CXF JAX-RS Extensions: Providers (2.7.0)
      [2135] [Active     ] [            ] [       ] [   40] Apache CXF JAX-RS Extensions: Search (2.7.0)
      [2136] [Active     ] [Created     ] [       ] [   40] Apache CXF Runtime JAX-RS Frontend (2.7.0)
      [2138] [Active     ] [            ] [       ] [   40] Apache CXF Runtime JAXB DataBinding (2.7.0)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sergey_beryozkin Sergey Beryozkin
                Reporter:
                ceefour Hendy Irawan
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: