felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-3003) NPE in ResolverImpl.permutateIfNeeded
Date Mon, 20 Jun 2011 16:34:47 GMT

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

Torsten commented on FELIX-3003:
--------------------------------

Unfortunately I cannot provide our bundles for testing, but this is basically what I am doing:

A standard java client (outside of Karaf) sends a ActiveMQObjectMessage that contains classes
defined in bundle A to a JMS broker running inside Karaf. (I've installed the "activemq-blueprint"
feature and created a local broker.)

Bundle A ("API") contains the domain objects. The Karaf headers command shows essentially:
...
Tool = Bnd-1.15.0
Bundle-SymbolicName = my.api
Bundle-Version = 1.0.0.SNAPSHOT
Export-Package = 
my.api;version=1.0.0,
...

Bundle B ("Service") defines a JMS Listener through a Spring configuration and receives the
ActiveMQObjectMessage from the local JMS broker.
...
Tool = Bnd-1.15.0
Bundle-SymbolicName = my.service
Bundle-Version = 1.0.0.SNAPSHOT
Import-Package = 
my.api;resolution:=optional;version="[1.0,2)",
org.apache.activemq;resolution:=optional,
org.springframework.beans.factory.config;resolution:=optional;version="[3.0,4)",
org.springframework.jms.core;resolution:=optional,
...

Looking at the stacktrace, it looks like ActiveMQ tries to load the domain class (via Class.forName)
and Felix does not find "candidates for the requirement" as seen in the source:

{code:title=ResolverImpl.java|borderStyle=solid}
ResolverImpl.permutateIfNeeded(
Map<Requirement, Set<Capability>> candidateMap, Requirement req, List<Map<Requirement,
Set<Capability>>> permutations) {
	Set<Capability> candidates = candidateMap.get(req);
	if (candidates.size() > 1) //<-- NPE is thrown here
{code}

I am not sure if this helps. Do you need other infos?

> NPE in ResolverImpl.permutateIfNeeded
> -------------------------------------
>
>                 Key: FELIX-3003
>                 URL: https://issues.apache.org/jira/browse/FELIX-3003
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: karaf 2.2.1, activemq 5.5.0
>            Reporter: Torsten
>
> After upgrade to Karaf 2.2.1, I noticed the following NPE in the Felix framework code:
> 14:31:54,306 | WARN  | tenerContainer-1 | AbstractMessageListenerContainer  694 | b120
| Execution of JMS message listener failed, and no ErrorHandler has been set.
> java.lang.NullPointerException
> 	at org.apache.felix.framework.resolver.ResolverImpl.permutateIfNeeded(ResolverImpl.java:1156)
> 	at org.apache.felix.framework.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1085)
> 	at org.apache.felix.framework.resolver.ResolverImpl.resolve(ResolverImpl.java:171)
> 	at org.apache.felix.framework.Felix$FelixResolver.resolve(Felix.java:4103)
> 	at org.apache.felix.framework.ModuleImpl.searchDynamicImports(ModuleImpl.java:1412)
> 	at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:734)
> 	at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> 	at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)[:1.6.0_20]
> 	at java.lang.Class.forName0(Native Method)[:1.6.0_20]
> 	at java.lang.Class.forName(Class.java:247)[:1.6.0_20]
> 	at org.apache.activemq.util.ClassLoadingAwareObjectInputStream.load(ClassLoadingAwareObjectInputStream.java:63)
> 	at org.apache.activemq.util.ClassLoadingAwareObjectInputStream.resolveClass(ClassLoadingAwareObjectInputStream.java:37)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)[:1.6.0_20]
> 	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)[:1.6.0_20]
> 	at java.util.ArrayList.readObject(ArrayList.java:593)[:1.6.0_20]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_20]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_20]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_20]
> 	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_20]
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)[:1.6.0_20]
> 	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)[:1.6.0_20]
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)[:1.6.0_20]
> 	at org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:184)[103:org.apache.activemq.activemq-core:5.5.0]
> 	at org.springframework.jms.support.converter.SimpleMessageConverter.extractSerializableFromMessage(SimpleMessageConverter.java:215)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.support.converter.SimpleMessageConverter.fromMessage(SimpleMessageConverter.java:103)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.adapter.MessageListenerAdapter.extractMessage(MessageListenerAdapter.java:407)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:345)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)[120:org.springframework.jms:3.0.5.RELEASE]
> 	at java.lang.Thread.run(Thread.java:619)[:1.6.0_20]
> I guess there is nothing I can do except downgrading to karaf 2.2.0? Any other ideas?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message