Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5516

Null Pointer On Deployment When Jetty Bean is used in Blueprint with REST DSL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.2.1
    • Fix Version/s: None
    • Component/s: Camel
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Reproducer attached. Original issue had an SSL configuration, but any jetty configuration appears to reproduce the issue. The attached reproducer just sets some basic socket properties. A version without the bean configuration is also attached and deploys without errors.

      Just build and run fabric8:deploy to a Fuse fabric instance, then provision a container with the new profile.

      Show
      Reproducer attached. Original issue had an SSL configuration, but any jetty configuration appears to reproduce the issue. The attached reproducer just sets some basic socket properties. A version without the bean configuration is also attached and deploys without errors. Just build and run fabric8:deploy to a Fuse fabric instance, then provision a container with the new profile.

      Description

      When a customized jetty bean is added to a blueprint and referenced in a <restConfiguration> element, a NullPointerException is thrown out of org.apache.camel.component.jetty.JettyHttpComponent.createConsumer. This appears to be caused by an attempt to access the CamelContext as an instance variable, though the Context is passed into the method. There also does not appear to be a way to pass the context to setProperties on the DefaultComponent, so when the above is changed, an Exception is thrown out of setProperties:

      java.lang.NullPointerException
      	at org.apache.camel.component.jetty.JettyHttpComponent.createConsumer(JettyHttpComponent.java:892)[238:org.apache.camel.camel-jetty-common:2.15.1.redhat-621090]
      	at org.apache.camel.component.rest.RestEndpoint.createConsumer(RestEndpoint.java:246)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:68)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:85)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3090)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3020)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2797)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2653)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)[198:org.apache.camel.camel-core:2.15.1.redhat-621090]
      	at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:180)[204:org.apache.camel.camel-blueprint:2.15.1.redhat-621090]
      	at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:212)[204:org.apache.camel.camel-blueprint:2.15.1.redhat-621090]
      	at org.apache.camel.blueprint.BlueprintCamelContext.serviceChanged(BlueprintCamelContext.java:150)[204:org.apache.camel.camel-blueprint:2.15.1.redhat-621090]
      	at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:943)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:794)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4445)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.Felix.registerService(Felix.java:3431)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:453)[23:org.apache.aries.blueprint.core:1.4.4]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:388)[23:org.apache.aries.blueprint.core:1.4.4]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[23:org.apache.aries.blueprint.core:1.4.4]
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:294)[23:org.apache.aries.blueprint.core:1.4.4]
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:263)[23:org.apache.aries.blueprint.core:1.4.4]
      	at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:253)[23:org.apache.aries.blueprint.core:1.4.4]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[17:org.apache.aries.util:1.1.0]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[17:org.apache.aries.util:1.1.0]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[17:org.apache.aries.util:1.1.0]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[17:org.apache.aries.util:1.1.0]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[17:org.apache.aries.util:1.1.0]
      	at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1127)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.Felix.startBundle(Felix.java:2100)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976)[org.apache.felix.framework-4.4.1.jar:]
      	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963)[org.apache.felix.framework-4.4.1.jar:]
      	at io.fabric8.agent.service.Agent$BaseDeployCallback.startBundle(Agent.java:482)[142:io.fabric8.fabric-agent:1.2.0.redhat-621090]
      	at io.fabric8.agent.service.Deployer$3.call(Deployer.java:935)[142:io.fabric8.fabric-agent:1.2.0.redhat-621090]
      	at io.fabric8.agent.service.Deployer$3.call(Deployer.java:930)[142:io.fabric8.fabric-agent:1.2.0.redhat-621090]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_91]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_91]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_91]
      	at java.lang.Thread.run(Thread.java:745)[:1.7.0_91]
      

        Attachments

        1. rest-without-jetty-bean.zip
          18 kB
        2. rest-with-jetty-bean.zip
          18 kB
        3. blueprint.xml
          2 kB

          Activity

            People

            Assignee:
            jpoth John Poth
            Reporter:
            hawkinsds Duane Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: