Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5010D11882 for ; Wed, 17 Sep 2014 16:26:34 +0000 (UTC) Received: (qmail 75914 invoked by uid 500); 17 Sep 2014 16:26:34 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 75844 invoked by uid 500); 17 Sep 2014 16:26:34 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 75829 invoked by uid 99); 17 Sep 2014 16:26:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2014 16:26:34 +0000 Date: Wed, 17 Sep 2014 16:26:33 +0000 (UTC) From: "Guillaume Nodet (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FELIX-4642) NPE in the resolver when substituting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 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)