felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-4642) NPE in the resolver when substituting
Date Wed, 17 Sep 2014 16:26:33 GMT

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

Guillaume Nodet commented on FELIX-4642:
----------------------------------------

I think this is caused by a call to {{clearCandidates}} somewhere.

I propose the following patch, though I'm not entirely sure if the test is ok or if it should
be inverted.
Thoughts welcomed !
{code}
diff --git a/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java b/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
index 6ada758..e8b5d2f 100644
--- a/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
+++ b/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
@@ -1520,7 +1520,7 @@ public class ResolverImpl implements Resolver
             for (Candidates existingPerm : permutations)
             {
                 List<Capability> existingPermCands = existingPerm.getCandidates(req);
-                if (!existingPermCands.get(0).equals(candidates.get(0)))
+                if (existingPermCands == null || !existingPermCands.get(0).equals(candidates.get(0)))
                 {
                     permutated = true;
                 }
{code}

> NPE in the resolver when substituting
> -------------------------------------
>
>                 Key: FELIX-4642
>                 URL: https://issues.apache.org/jira/browse/FELIX-4642
>             Project: Felix
>          Issue Type: Bug
>          Components: Resolver
>    Affects Versions: resolver-1.2.0
>            Reporter: Guillaume Nodet
>             Fix For: resolver-1.2.0
>
>
> {code}
> 2014-09-17 11:01:13,035 | ERROR | agent-5-thread-1 | DeploymentAgent                
 | ?                                   ? | 76 - io.fabric8.fabric-agent - 1.2.0.SNAPSHOT |
Unable to update agent
> java.lang.NullPointerException
> 	at org.apache.felix.resolver.ResolverImpl.permutateIfNeeded(ResolverImpl.java:1523)[76:io.fabric8.fabric-agent:1.2.0.SNAPSHOT]
> 	at org.apache.felix.resolver.Candidates.checkSubstitutes(Candidates.java:447)[76:io.fabric8.fabric-agent:1.2.0.SNAPSHOT]
> 	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:225)[76:io.fabric8.fabric-agent:1.2.0.SNAPSHOT]
> 	at io.fabric8.agent.DeploymentBuilder.resolve(DeploymentBuilder.java:243)[76:io.fabric8.fabric-agent:1.2.0.SNAPSHOT]
> 	at io.fabric8.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:588)[76:io.fabric8.fabric-agent:1.2.0.SNAPSHOT]
> 	at io.fabric8.agent.DeploymentAgent$2.run(DeploymentAgent.java:313)[76:io.fabric8.fabric-agent:1.2.0.SNAPSHOT]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_51]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_51]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_51]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_51]
> 	at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message