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

Thomas Watson commented on FELIX-5998:
--------------------------------------

My point about equality check is that by design the resolver assumes the 
resources do basically an identity equals implementation.  The issue I was 
pointing out with FELIX-5389 is that the felix bnd resource was doing a deep 
equals check and as long as all the capabilities/requirements 
attributes/directives of the two resources were identical then it would return 
true from equals.  But that caused asymmetric equals between bnd resource B and 
the resolver wrapped resource W such that W.equals(B) != B.equals(W).  For 
resource B that gets wrapped into resource W we really need the W.equals(B) and 
B.equals(W) to both always return false because from the POV of the resolver 
the two resources must not be equal.

The equals check for the FelixResourceAdaptor is worse off than the the BND one 
because it only checks equals on the resource type, symbolic name, and version. 
 But during resolution the wrapped resource may get augmented with additional 
requirements/capabilities as new fragments get merged into the host.  This is 
why we cannot allow the wrapped resource W to ever equal the resource B that it 
is wrapping.

> NPE in Resolver checkPackageSpaceConsistency
> --------------------------------------------
>
>                 Key: FELIX-5998
>                 URL: https://issues.apache.org/jira/browse/FELIX-5998
>             Project: Felix
>          Issue Type: Task
>          Components: Resolver
>    Affects Versions: resolver-2.0.0
>            Reporter: Pierre De Rop
>            Priority: Major
>
> I'm using a custom ResolveContext implementation that I've written in order 
> to calculate the dependencies of some applications which bundles are all 
> centralized in an OBR. Now, using the Felix framework 6.0.1 (and the Resolver 
> 2.0.0 that is provided by the framework), I sometimes get an NPE in the 
> ResolverImpl.checkPackageSpaceConsistency, line 1319). 
> My OBR is not yet fully "curated" (I still have some " Candidate permutation 
> failed due to a conflict between imports" logs when enabling 
> felix.log.level=4). So I'm cleaning the OBR gradually, but now, sometimes  I 
> see this NPE while resolving :
> {code:java}
> java.lang.NullPointerException
> at 
> org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1319)
> at 
> org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1500)
> at 
> org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1500)
> at 
> org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1500)
> at 
> org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1500)
> at 
> org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1500)
> at 
> org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1500)
> at 
> org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1500)
> at 
> org.apache.felix.resolver.ResolverImpl.checkConsistency(ResolverImpl.java:622)
> at 
> org.apache.felix.resolver.ResolverImpl.findValidCandidates(ResolverImpl.java:575)
> at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:438)
> at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421)
> at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:414)
> at 
> com.nokia.as.microfeatures.bundlerepository.impl.BundleRepositoryImpl.findResolution(BundleRepositoryImpl.java:257)
> {code}
> The bad thing is that I'm not able to reproduce the NPE when I enable 
> felix.log.level=4, and the NPE is difficult to reproduce.
> Could someone please give me a clue about what could produce this NPE ? Are 
> there some traces which could be added in order to figure out what is the 
> problem ? Then is there a fix which should be done in order to avoid this 
> null pointer ?
> If I fully cleanup my OBR, maybe I won't have anymore the NPE, but I just 
> wanted to report it here.
> thank you.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to