felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-3003) NPE in ResolverImpl.permutateIfNeeded
Date Fri, 15 Jun 2012 17:32:50 GMT

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

Richard S. Hall commented on FELIX-3003:
----------------------------------------

Charles Moulliard sent me a scenario to reproduce this issue and I think I understand what
is going on...

It is directly related to resolving dynamic imports. It occurs because they are a special
case. Similar to what Torsten reported, Charles scenario generated the NPE due to underlying
resolution error while trying to permutate the candidates.

The reason why we were seeing a null candidates set here when we normally shouldn't see null
is because dynamic importing is a special case where the revision is already resolved and
we are just trying to resolve a single additional requirement for it. Thus, we only populate
the candidates set for the single requirement we are trying to resolve, not all existing requirements
that already have a wire.

The issue then arises in a situation where the resolver detects a conflict with the new requirement's
candidate and the provider of an existing wire. In that case, it tries to permutate the "original"
decision by getting its candidates. Since resolved requirements do not populate the candidates
set, we get an NPE because there is nothing there to permutate.

So, technically, just adding a null check here may be ok. Another approach is to populate
already resolved requirements as only having one candidate, which is the provider of the wire.
I'll think about this a little bit, but we should be able to do something here. This issue
still exists in 4.0.x, so it will be a good fix.

Thanks to all.
                
> 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
>         Attachments: felix-3003-bundle103-headers.txt, felix-3003-bundle123-headers.txt,
felix-3003-resolverimpl-sysout-NPE.txt
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message