Uploaded image for project: 'ServiceMix'
  1. ServiceMix
  2. SM-2338

cm:property-placeholder and camelContext conflict with each other on redeploy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Won't Fix
    • 5.0.0, 5.0.1
    • 5.6.3
    • servicemix-camel
    • None

    Description

      The simple jar bundle (attached) with blueprint below deploys successfully, but triggers NPE on bundle file update or manual OSGi bundle refresh.

      Surprisingly, deploying blueprint.xml directly (instead of a jar bundle) works fine.

      <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
                 xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">
      
          <cm:property-placeholder persistent-id="com.example.test">
              <cm:default-properties>
                  <cm:property name="test" value="10"/>
              </cm:default-properties>
          </cm:property-placeholder>
      
          <camelContext xmlns="http://camel.apache.org/schema/blueprint"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:schemaLocation="http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
      
              <route>
                  <from uri="direct:a"/>
                  <to uri="direct:b"/>
              </route>
      
          </camelContext>
      
      </blueprint>
      

      Exception stacktrace:

      16:01:02,317 | INFO  | mix-5.0.1/deploy | fileinstall                      | 6 - org.apache.felix.fileinstall - 3.2.8 | Updated /home/lightoze/work/3rd/apache-servicemix-5.0.1/deploy/test-bundle.jar
      16:01:02,339 | WARN  | mix-5.0.1/deploy | BeanRecipe                       | 7 - org.apache.aries.blueprint.core - 1.4.0 | Object to be destroyed is not an instance of UnwrapperedBeanHolder, type: null
      16:01:02,340 | ERROR | mix-5.0.1/deploy | BlueprintContainerImpl           | 7 - org.apache.aries.blueprint.core - 1.4.0 | Unable to start blueprint container for bundle test-bundle.jar
      org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.NullPointerException
              at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:122)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7:org.apache.aries.blueprint.core:1.4.0]
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_55]
              at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:933)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:907)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7:org.apache.aries.blueprint.core:1.4.0]
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_55]
              at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:230)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:155)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:527)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:361)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:245)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:235)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[10:org.apache.aries.util:1.1.0]
              at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[10:org.apache.aries.util:1.1.0]
              at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[10:org.apache.aries.util:1.1.0]
              at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[10:org.apache.aries.util:1.1.0]
              at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[10:org.apache.aries.util:1.1.0]
              at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)[org.apache.felix.framework-4.0.3.jar:]
              at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:695)[org.apache.felix.framework-4.0.3.jar:]
              at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:483)[org.apache.felix.framework-4.0.3.jar:]
              at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4244)[org.apache.felix.framework-4.0.3.jar:]
              at org.apache.felix.framework.Felix.startBundle(Felix.java:1923)[org.apache.felix.framework-4.0.3.jar:]
              at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)[org.apache.felix.framework-4.0.3.jar:]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1263)[6:org.apache.felix.fileinstall:3.2.8]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1235)[6:org.apache.felix.fileinstall:3.2.8]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1224)[6:org.apache.felix.fileinstall:3.2.8]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:519)[6:org.apache.felix.fileinstall:3.2.8]
              at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:308)[6:org.apache.felix.fileinstall:3.2.8]
      Caused by: java.lang.NullPointerException
              at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)[org.apache.felix.framework-4.0.3.jar:]
              at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:]
              at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:412)[:1.7.0_55]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_55]
              at java.lang.Class.forName0(Native Method)[:1.7.0_55]
              at java.lang.Class.forName(Class.java:270)[:1.7.0_55]
              at org.apache.aries.proxy.impl.interfaces.ProxyClassLoader.isInvalid(ProxyClassLoader.java:109)[12:org.apache.aries.proxy.impl:1.0.2]
              at org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator.getProxyInstance(InterfaceProxyGenerator.java:84)[12:org.apache.aries.proxy.impl:1.0.2]
              at org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:72)[12:org.apache.aries.proxy.impl:1.0.2]
              at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:75)[12:org.apache.aries.proxy.impl:1.0.2]
              at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingProxy(AbstractProxyManager.java:40)[12:org.apache.aries.proxy.impl:1.0.2]
              at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.createProxy(AbstractServiceReferenceRecipe.java:338)[7:org.apache.aries.blueprint.core:1.4.0]
              at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:106)[7:org.apache.aries.blueprint.core:1.4.0]
              ... 36 more
      

      Attachments

        1. test-bundle.jar
          1.0 kB
          Vladimir Kulev

        Activity

          People

            Unassigned Unassigned
            lightoze Vladimir Kulev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: