Aries
  1. Aries
  2. ARIES-954

org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.NullPointerException - need better error message

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: blueprint-core-1.0.1
    • Fix Version/s: None
    • Component/s: Blueprint
    • Labels:
      None
    • Environment:

      Description

      Trying to deploy my bundle, I get this exception :

      2012-11-01 14:42:14,477 | 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.security
      org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.NullPointerException
              at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:295)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:247)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:234)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.ServiceRecipe.getClasses(ServiceRecipe.java:367)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:185)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:668)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:352)[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: java.lang.NullPointerException
              at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)[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.di.RefRecipe.internalCreate(RefRecipe.java:62)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:280)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[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.create(AbstractRecipe.java:106)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:268)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[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.di.RefRecipe.internalCreate(RefRecipe.java:62)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)[7:org.apache.aries.blueprint.core:1.0.1]
              at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:280)[7:org.apache.aries.blueprint.core:1.0.1]
              ... 16 more
      

      The Blueprint XML:

      <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
          xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
          xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0
              http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0
              http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0 http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0
              http://karaf.apache.org/xmlns/shell/v1.1.0 http://karaf.apache.org/xmlns/shell/v1.1.0">
      
      	<reference id="svcLookup" interface="org.soluvas.multitenant.ServiceLookup"/>
      
      	<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
      		<command name="sec/rolels">
      			<action class="org.soluvas.security.shell.SecRoleLsCommand">
      				<argument ref="svcLookup" />
      			</action>
      		</command>
      		<command name="sec/actionls">
      			<action class="org.soluvas.security.shell.SecActionLsCommand">
      				<argument ref="svcLookup" />
      			</action>
      		</command>
      		<command name="sec/domainls">
      			<action class="org.soluvas.security.shell.SecDomainLsCommand">
      				<argument ref="svcLookup" />
      			</action>
      		</command>
      		<command name="sec/permls">
      			<action class="org.soluvas.security.shell.SecPermLsCommand">
      				<argument ref="svcLookup" />
      			</action>
      		</command>
      	</command-bundle>
      	
      	<bean class="org.soluvas.commons.EmfUnloader" destroy-method="destroy">
      		<argument value="org.soluvas.security.SecurityPackage" />
      	</bean>
      
      	<bean id="defaultSecurityCatalogSupplier" class="org.soluvas.commons.XmiObjectLoader">
      		<argument type="java.lang.Class" value="org.soluvas.security.SecurityPackage" />
      		<argument value="org.soluvas.security.SecurityPackage" />
      		<argument value="default.SecurityCatalog.xmi" />
      	</bean>
      	<service ref="defaultSecurityCatalogSupplier" auto-export="interfaces">
      		<service-properties>
      			<entry key="clientId" value="berbatik" />
      			<entry key="tenantId" value="berbatik" />
      			<entry key="tenantEnv" value="dev" />
      			<entry key="suppliedClass" value="org.soluvas.security.SecurityCatalog" />
      			<entry key="layer" value="module" />
      		</service-properties>
      	</service>
      	
      	<bean id="securityPackage" class="org.soluvas.security.impl.SecurityPackageImpl" factory-method="init" />
      	<bean id="aggregatingSecurityCatalogSupplier" class="org.soluvas.commons.AggregatingSupplier">
      		<argument>
      			<bean class="org.soluvas.security.impl.SecurityFactoryImpl" />
      		</argument>
      		<argument>
      			<bean factory-ref="securityPackage" factory-method="getSecurityCatalog" />
      		</argument>
      		<argument>
      			<list>
      <!-- 				<ref component-id="defaultSecurityCatalogSupplier"/> -->
      <!-- 				<ref component-id="bippoSecurityCatalogSupplier"/> -->
      			</list>
      		</argument>
      	</bean>
      	<service ref="aggregatingSecurityCatalogSupplier" auto-export="interfaces">
      		<service-properties>
      			<entry key="clientId" value="berbatik" />
      			<entry key="tenantId" value="berbatik" />
      			<entry key="tenantEnv" value="dev" />
      			<entry key="suppliedClass" value="org.soluvas.security.SecurityCatalog" />
      			<entry key="layer" value="application" />
      		</service-properties>
      	</service>
      	
      	<bean id="securityCatalogSupplierTracker" class="org.soluvas.security.SecurityCatalogSupplierTracker">
      		<argument ref="blueprintBundleContext" />
      		<argument ref="aggregatingSecurityCatalogSupplier" />
      	</bean>
      	<bean class="org.osgi.util.tracker.ServiceTracker" init-method="open" destroy-method="close">
      		<argument ref="blueprintBundleContext" />
      		<argument>
      			<bean class="org.osgi.framework.FrameworkUtil" factory-method="createFilter">
      				<argument value="(&amp;(objectClass=com.google.common.base.Supplier)(suppliedClass=org.soluvas.security.SecurityCatalog)(tenantId=berbatik)(tenantEnv=dev)(layer=module))" />
      			</bean>
      		</argument>
      		<argument ref="securityCatalogSupplierTracker" />
      	</bean>
      
      </blueprint>
      

      I suspect something's amiss in my class, however the exceptiong given by Blueprint should be more helpful.

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Hendy Irawan
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development