aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hendy Irawan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARIES-954) org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.NullPointerException - need better error message
Date Thu, 01 Nov 2012 08:11:11 GMT

    [ https://issues.apache.org/jira/browse/ARIES-954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13488539#comment-13488539
] 

Hendy Irawan commented on ARIES-954:
------------------------------------

Use case is here:

https://github.com/soluvas/soluvas-framework/tree/ARIES-954/security
                
> org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.NullPointerException
- need better error message
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-954
>                 URL: https://issues.apache.org/jira/browse/ARIES-954
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: blueprint-core-1.0.1
>         Environment: Karaf
>   Karaf version               2.3.0
>   Karaf home                  /home/ceefour/git/bippo-commerce5/karaf
>   Karaf base                  /home/ceefour/git/bippo-commerce5/karaf
>   OSGi Framework              org.apache.felix.framework - 4.0.3
> JVM
>   Java Virtual Machine        OpenJDK 64-Bit Server VM version 23.2-b09
>   Version                     1.7.0_07
>   Vendor                      Oracle Corporation
>   Uptime                      8 minutes
>   Total compile time          27.900 seconds
> Threads
>   Live threads                129
>   Daemon threads              114
>   Peak                        132
>   Total started               324
> Memory
>   Current heap size           170,000 kbytes
>   Maximum heap size           466,048 kbytes
>   Committed heap size         277,248 kbytes
>   Pending objects             0
>   Garbage collector           Name = 'PS Scavenge', Collections = 71, Time = 0.417 seconds
>   Garbage collector           Name = 'PS MarkSweep', Collections = 2, Time = 0.331 seconds
> Classes
>   Current classes loaded      10,383
>   Total classes loaded        10,543
>   Total classes unloaded      160
> Operating system
>   Name                        Linux version 3.2.0-32-generic
>   Architecture                amd64
>   Processors                  8
>            Reporter: Hendy Irawan
>
> Trying to deploy my bundle, I get this exception :
> {code}
> 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
> {code}
> The Blueprint XML:
> {code}
> <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>
> {code}
> I suspect something's amiss in my class, however the exceptiong given by Blueprint should
be more helpful.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message