You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Rudi Wijaya (JIRA)" <ji...@apache.org> on 2012/10/29 10:01:17 UTC
[jira] [Commented] (ARIES-951) NullPointerException at
felix.framework.BundleWiringImpl.findClassOrResourceByDelegation
[ https://issues.apache.org/jira/browse/ARIES-951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485900#comment-13485900 ]
Rudi Wijaya commented on ARIES-951:
-----------------------------------
The culprit lines is here in our Blueprint XML:
{code}
<reference id="personRawRepo" interface="id.co.bippo.person.BippoPersonRepository" availability="optional"
filter="(&(tenantId=berbatik)(tenantEnv=dev)(namespace=)(repositoryMode=raw))"/>
{code}
Commenting it makes Aries not throw NPE (although the bundle itself won't do its intended work).
> NullPointerException at felix.framework.BundleWiringImpl.findClassOrResourceByDelegation
> ----------------------------------------------------------------------------------------
>
> Key: ARIES-951
> URL: https://issues.apache.org/jira/browse/ARIES-951
> Project: Aries
> Issue Type: Bug
> Components: Blueprint
> Affects Versions: blueprint-core-1.0.1
> Environment: Karaf
> Karaf version 2.3.0
> Karaf home /home/rudi/git/bippo-commerce5/karaf
> Karaf base /home/rudi/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_09
> Vendor Oracle Corporation
> Uptime 1 hour 19 minutes
> Total compile time 52.961 seconds
> Threads
> Live threads 111
> Daemon threads 96
> Peak 138
> Total started 855
> Memory
> Current heap size 67,790 kbytes
> Maximum heap size 466,048 kbytes
> Committed heap size 150,592 kbytes
> Pending objects 0
> Garbage collector Name = 'PS Scavenge', Collections = 521, Time = 3.474 seconds
> Garbage collector Name = 'PS MarkSweep', Collections = 5, Time = 1.233 seconds
> Classes
> Current classes loaded 11,648
> Total classes loaded 13,225
> Total classes unloaded 1,577
> Operating system
> Name Linux version 3.2.0-32-generic
> Architecture amd64
> Processors 4
> Reporter: Rudi Wijaya
>
> Note: This happens on blueprint 1.0.0, but for some reason I can't find it in the Versions list, so I picked blueprint-core-1.0.1.
> I'm not yet sure what causes this Exception, but it is the error message given by Aries Blueprint isn't very helpful at this point:
> Unable to start blueprint container for bundle id.co.bippo.person.rs
> org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.NullPointerException
> at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:116)
> {code}
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0"
> xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
> http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0 http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0">
>
> <reference id="ldapPool" interface="org.apache.commons.pool.ObjectPool"
> filter="(&(tenantId=berbatik)(tenantEnv=dev)(namespace=ldap))"/>
> <reference id="appSessionUtils" interface="tmp.org.soluvas.app.AppSessionUtils"
> filter="(&(tenantId=berbatik)(tenantEnv=dev))"/>
> <reference id="facebookUtils" interface="org.soluvas.facebook.FacebookUtils" ext:proxy-method="classes"/>
>
> <reference id="personRawRepo" interface="id.co.bippo.person.BippoPersonRepository"
> filter="(&(tenantId=berbatik)(tenantEnv=dev)(namespace=)(repositoryMode=raw))"/>
>
> <bean id="personRsSys" class="id.co.bippo.person.rs.hand.PersonResourceSys">
> <!-- <argument ref="personRawRepo"/> -->
> <argument><null/></argument>
> </bean>
> <bean id="personRs" class="id.co.bippo.person.rs.hand.PersonResource">
> <argument ref="ldapPool"/>
> <argument ref="appSessionUtils"/>
> <argument ref="facebookUtils"/>
> </bean>
>
>
> <service auto-export="interfaces">
> <service-properties>
> <entry key="clientId" value="berbatik"/>
> <entry key="tenantId" value="berbatik"/>
> <entry key="tenantEnv" value="dev"/>
> <entry key="type" value="jaxrs"/>
> <entry key="address" value="api"/>
> </service-properties>
> <bean class="java.util.ArrayList">
> <argument>
> <list>
> <ref component-id="personRs"/>
> <ref component-id="personRsSys"/>
> </list>
> </argument>
> </bean>
> </service>
>
> </blueprint>
> {code}
> Log & stacktrace from the time the bundle is detected:
> {code}
> 2012-10-29 15:45:42,631 | DEBUG | lixDispatchQueue | rs | ? ? | 1485 - id.co.bippo.person.rs - 5.0.0.SNAPSHOT | BundleEvent STOPPED - id.co.bippo.person.rs
> 2012-10-29 15:45:42,648 | DEBUG | lixDispatchQueue | rs | ? ? | 1485 - id.co.bippo.person.rs - 5.0.0.SNAPSHOT | BundleEvent UNRESOLVED - id.co.bippo.person.rs
> 2012-10-29 15:45:42,648 | INFO | ce5/karaf/deploy | fileinstall | ? ? | 6 - org.apache.felix.fileinstall - 3.2.6 | Updated /home/rudi/git/bippo-commerce5/karaf/deploy/id.co.bippo.person.rs
> 2012-10-29 15:45:42,649 | DEBUG | lixDispatchQueue | rs | ? ? | 1485 - id.co.bippo.person.rs - 5.0.0.SNAPSHOT | BundleEvent UPDATED - id.co.bippo.person.rs
> 2012-10-29 15:45:42,685 | INFO | ce5/karaf/deploy | fileinstall | ? ? | 6 - org.apache.felix.fileinstall - 3.2.6 | Started bundle: jardir:/home/rudi/git/bippo-commerce5/karaf/deploy/id.co.bippo.person.rs
> 2012-10-29 15:45:42,685 | DEBUG | lixDispatchQueue | rs | ? ? | 1485 - id.co.bippo.person.rs - 5.0.0.SNAPSHOT | BundleEvent RESOLVED - id.co.bippo.person.rs
> 2012-10-29 15:45:42,686 | DEBUG | lixDispatchQueue | rs | ? ? | 1485 - id.co.bippo.person.rs - 5.0.0.SNAPSHOT | BundleEvent STARTED - id.co.bippo.person.rs
> 2012-10-29 15:45:42,693 | DEBUG | rint Extender: 3 | rs | ? ? | 1485 - id.co.bippo.person.rs - 5.0.0.SNAPSHOT | ServiceEvent REGISTERED - [java.util.List, java.lang.Iterable, java.io.Serializable, java.util.RandomAccess, java.lang.Cloneable, java.util.Collection] - id.co.bippo.person.rs
> 2012-10-29 15:45:42,694 | INFO | rint Extender: 3 | DynamicJaxrsManager | .soluvas.cxf.DynamicJaxrsManager 105 | 1429 - com.soluvas.cxf - 1.0.0.SNAPSHOT | Adding 2 new JAX-RS resources: [id.co.bippo.person.rs.hand.PersonResource@35674ac2, id.co.bippo.person.rs.hand.PersonResourceSys@105d21f2]
> 2012-10-29 15:45:42,695 | INFO | rint Extender: 3 | DynamicJaxrsManager | .soluvas.cxf.DynamicJaxrsManager 68 | 1429 - com.soluvas.cxf - 1.0.0.SNAPSHOT | Starting JAX-RS server with 19 resources: [id.co.bippo.product.rs.hand.ProductResourceSys@6b6f787d, id.co.bippo.product.rs.hand.ProductResourceShop@634f8da5, id.co.bippo.product.rs.hand.ProductResourceMall@7bdc7e92, id.co.bippo.product.rs.hand.ProductResourcePub@48f9e2c5, org.soluvas.web.site.rs.SiteResource@3e90dfa2, id.co.bippo.wink.rs.hand.ProductWinkResource@4b253c8f, org.soluvas.web.backbone.RequireResource@763480e3, org.soluvas.image.rs.ImageResource@36d1c1fe, id.co.bippo.salesorder.rs.hand.SalesOrderResource@582a0ed8, id.co.bippo.salesorder.rs.hand.PersonResource@3134b420, id.co.bippo.story.rs.hand.ProductStoryResource@28e70a67, id.co.bippo.story.rs.hand.PersonStoryResource@585c052b, id.co.bippo.story.rs.hand.ShopStoryResource@157775f, id.co.bippo.like.rs.hand.ProductLikeResource@1d3e98d8, id.co.bippo.comment.rs.hand.ShopCommentResource@5da354e7, id.co.bippo.comment.rs.hand.ProductCommentResource@1d16095c, id.co.bippo.comment.rs.hand.PersonCommentResource@222b72db, id.co.bippo.person.rs.hand.PersonResource@35674ac2, id.co.bippo.person.rs.hand.PersonResourceSys@105d21f2]
> 2012-10-29 15:45:42,705 | INFO | rint Extender: 3 | ServerImpl | g.apache.cxf.endpoint.ServerImpl 94 | 205 - org.apache.cxf.cxf-api - 2.6.3 | Setting the server's publish address to be /api/berbatik_dev
> 2012-10-29 15:45:42,706 | INFO | rint Extender: 3 | InstrumentationManagerImpl | t.jmx.InstrumentationManagerImpl 329 | 207 - org.apache.cxf.cxf-rt-management - 2.6.3 | registering MBean org.apache.cxf:bus.id=id.co.bippo.app-cxf1001197797,type=Bus.Service.Endpoint,service="{http://hand.rs.product.bippo.co.id/}ProductResourceSys",port="ProductResourceSys",instance.id=213731888: org.apache.cxf.endpoint.ManagedEndpoint@5f519bd8
> 2012-10-29 15:45:42,707 | INFO | rint Extender: 3 | InstrumentationManagerImpl | t.jmx.InstrumentationManagerImpl 329 | 207 - org.apache.cxf.cxf-rt-management - 2.6.3 | registering MBean org.apache.cxf:bus.id=id.co.bippo.app-cxf1001197797,type=Bus.Service.Endpoint,service="{http://hand.rs.product.bippo.co.id/}ProductResourceSys",port="ProductResourceSys",instance.id=213731888: javax.management.modelmbean.RequiredModelMBean@66ceb2cb
> 2012-10-29 15:45:42,709 | DEBUG | rint Extender: 3 | rs | ? ? | 1485 - id.co.bippo.person.rs - 5.0.0.SNAPSHOT | ServiceEvent UNREGISTERING - [java.util.List, java.lang.Iterable, java.io.Serializable, java.util.RandomAccess, java.lang.Cloneable, java.util.Collection] - id.co.bippo.person.rs
> 2012-10-29 15:45:42,710 | INFO | rint Extender: 3 | DynamicJaxrsManager | .soluvas.cxf.DynamicJaxrsManager 127 | 1429 - com.soluvas.cxf - 1.0.0.SNAPSHOT | Removing 2 JAX-RS resources: [id.co.bippo.person.rs.hand.PersonResource@35674ac2, id.co.bippo.person.rs.hand.PersonResourceSys@105d21f2]
> 2012-10-29 15:45:42,710 | INFO | rint Extender: 3 | DynamicJaxrsManager | .soluvas.cxf.DynamicJaxrsManager 68 | 1429 - com.soluvas.cxf - 1.0.0.SNAPSHOT | Starting JAX-RS server with 17 resources: [id.co.bippo.product.rs.hand.ProductResourceSys@6b6f787d, id.co.bippo.product.rs.hand.ProductResourceShop@634f8da5, id.co.bippo.product.rs.hand.ProductResourceMall@7bdc7e92, id.co.bippo.product.rs.hand.ProductResourcePub@48f9e2c5, org.soluvas.web.site.rs.SiteResource@3e90dfa2, id.co.bippo.wink.rs.hand.ProductWinkResource@4b253c8f, org.soluvas.web.backbone.RequireResource@763480e3, org.soluvas.image.rs.ImageResource@36d1c1fe, id.co.bippo.salesorder.rs.hand.SalesOrderResource@582a0ed8, id.co.bippo.salesorder.rs.hand.PersonResource@3134b420, id.co.bippo.story.rs.hand.ProductStoryResource@28e70a67, id.co.bippo.story.rs.hand.PersonStoryResource@585c052b, id.co.bippo.story.rs.hand.ShopStoryResource@157775f, id.co.bippo.like.rs.hand.ProductLikeResource@1d3e98d8, id.co.bippo.comment.rs.hand.ShopCommentResource@5da354e7, id.co.bippo.comment.rs.hand.ProductCommentResource@1d16095c, id.co.bippo.comment.rs.hand.PersonCommentResource@222b72db]
> 2012-10-29 15:45:42,719 | INFO | rint Extender: 3 | ServerImpl | g.apache.cxf.endpoint.ServerImpl 94 | 205 - org.apache.cxf.cxf-api - 2.6.3 | Setting the server's publish address to be /api/berbatik_dev
> 2012-10-29 15:45:42,720 | INFO | rint Extender: 3 | InstrumentationManagerImpl | t.jmx.InstrumentationManagerImpl 329 | 207 - org.apache.cxf.cxf-rt-management - 2.6.3 | registering MBean org.apache.cxf:bus.id=id.co.bippo.app-cxf1001197797,type=Bus.Service.Endpoint,service="{http://hand.rs.product.bippo.co.id/}ProductResourceSys",port="ProductResourceSys",instance.id=2138402040: org.apache.cxf.endpoint.ManagedEndpoint@76454f27
> 2012-10-29 15:45:42,720 | INFO | rint Extender: 3 | InstrumentationManagerImpl | t.jmx.InstrumentationManagerImpl 329 | 207 - org.apache.cxf.cxf-rt-management - 2.6.3 | registering MBean org.apache.cxf:bus.id=id.co.bippo.app-cxf1001197797,type=Bus.Service.Endpoint,service="{http://hand.rs.product.bippo.co.id/}ProductResourceSys",port="ProductResourceSys",instance.id=2138402040: javax.management.modelmbean.RequiredModelMBean@404fc61a
> 2012-10-29 15:45:42,722 | 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.person.rs
> org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.NullPointerException
> at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:116)[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_09]
> at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_09]
> 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_09]
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_09]
> at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_09]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_09]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_09]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.7.0_09]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.7.0_09]
> at java.lang.Thread.run(Thread.java:722)[:1.7.0_09]
> Caused by: java.lang.NullPointerException
> at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)
> at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
> at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:410)[:1.7.0_09]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_09]
> at java.lang.Class.forName0(Native Method)[:1.7.0_09]
> at java.lang.Class.forName(Class.java:264)[:1.7.0_09]
> at org.apache.aries.proxy.impl.interfaces.ProxyClassLoader.isInvalid(ProxyClassLoader.java:109)[12:org.apache.aries.proxy.impl:1.0.0]
> at org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator.getProxyInstance(InterfaceProxyGenerator.java:84)[12:org.apache.aries.proxy.impl:1.0.0]
> at org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:72)[12:org.apache.aries.proxy.impl:1.0.0]
> at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingInterceptingProxy(AbstractProxyManager.java:75)[12:org.apache.aries.proxy.impl:1.0.0]
> at org.apache.aries.proxy.impl.AbstractProxyManager.createDelegatingProxy(AbstractProxyManager.java:40)[12:org.apache.aries.proxy.impl:1.0.0]
> at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.createProxy(AbstractServiceReferenceRecipe.java:299)[7:org.apache.aries.blueprint.core:1.0.1]
> at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:100)[7:org.apache.aries.blueprint.core:1.0.1]
> ... 18 more
> {code}
> The resource implementation :
> {code}
> package id.co.bippo.person.rs.hand;
> import id.co.bippo.person.BippoPersonRepository;
> import javax.ws.rs.Consumes;
> import javax.ws.rs.DELETE;
> import javax.ws.rs.Path;
> import javax.ws.rs.PathParam;
> import javax.ws.rs.Produces;
> import javax.ws.rs.core.MediaType;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> import tmp.org.soluvas.person.rs.Status;
> /**
> * @author rudi
> *
> */
> @Path("/person_sys")
> @Consumes(MediaType.APPLICATION_JSON)
> @Produces(MediaType.APPLICATION_JSON)
> public class PersonResourceSys {
>
> private transient Logger log = LoggerFactory
> .getLogger(PersonResourceSys.class);
> private transient BippoPersonRepository personRawRepo;
>
> public PersonResourceSys(BippoPersonRepository personRawRepo) {
> super();
> this.personRawRepo = personRawRepo;
> }
> @DELETE
> @Path("{id}")
> public Status deleteById(@PathParam("id") String id) {
> try {
> log.info("Deleting person by ID {}", id);
> personRawRepo.deleteById(id);
>
> return new Status("success", "", "Person with ID " + id + " was deleted.");
> } catch (Exception e) {
> log.error("Can't delete person by ID {}" + id, e);
> throw new RuntimeException("Can't delete person by ID {}" + id, e);
> }
> }
>
> }
> {code}
--
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