You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Pa...@telekom.de on 2018/07/24 11:35:12 UTC

Felix-Resolver: Fragment was not selected for attachment

Hi all,

during resolving of several bundles with the felixResolver I get a ResolutionException: org.apache.felix.resolver.reason.ReasonException: Fragment was not selected for attachment: com.xx.yy version=1.7.0.201806111251

But the unresolvedRequirments are 0 in the exception. This confuses me, why an exception is thrown but no unresolved Req. are there?

I found the origin of the error in that class: https://github.com/eclipse/rt.equinox.framework/blob/eb0f2a037d2e03d66f0eca857b16838745bbb2a2/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/Candidates.java
but it's hard for me to understand the comment:
 // For any fragment that wasn't selected, remove the
 // current host as a potential host for it and remove it
 // as a dependent on the host. If there are no more
// potential hosts for the fragment, then mark it as
// unselected for later removal.

Could someone explain me what happens during resolving here or even explain the code comment to me?

I tested with bndtools 3.5.0, 4.0.0 and 4.1.0-SNAPSHOT. All are producing the same ResolutionException.

Thanks and best regards,
Patrick


Re: Felix-Resolver: Fragment was not selected for attachment

Posted by "Richard S. Hall" <he...@ungoverned.org>.

On 7/24/18 07:35 , Patrick.Pussar@telekom.de wrote:
> Hi all,
>
> during resolving of several bundles with the felixResolver I get a ResolutionException: org.apache.felix.resolver.reason.ReasonException: Fragment was not selected for attachment: com.xx.yy version=1.7.0.201806111251
>
> But the unresolvedRequirments are 0 in the exception. This confuses me, why an exception is thrown but no unresolved Req. are there?
>
> I found the origin of the error in that class: https://github.com/eclipse/rt.equinox.framework/blob/eb0f2a037d2e03d66f0eca857b16838745bbb2a2/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/Candidates.java
> but it's hard for me to understand the comment:
>   // For any fragment that wasn't selected, remove the
>   // current host as a potential host for it and remove it
>   // as a dependent on the host. If there are no more
> // potential hosts for the fragment, then mark it as
> // unselected for later removal.
>
> Could someone explain me what happens during resolving here or even explain the code comment to me?

I'm not sure what's going on, but the only time the "else" should get 
triggered is if you are installing multiple versions of a given 
fragment. In that case, only the highest version of that fragment is 
"selected" and every other lower version hits the "else" and is removed 
as the comment above describes. So, first of all, are you installing 
multiple versions of the same fragment (i.e., same symbolic name)?

What it sounds like is happening, is that some module you are trying to 
resolve has a dependency (directly or indirectly) on something provided 
by an older version of the fragment, but that fragment isn't selected 
for merging into a host because there is a newer version of the fragment.

Whether or not that makes sense with respect to your use case, I have no 
idea, but that appears to be the only plausible explanation with the 
info provided.

-> richard

>
> I tested with bndtools 3.5.0, 4.0.0 and 4.1.0-SNAPSHOT. All are producing the same ResolutionException.
>
> Thanks and best regards,
> Patrick
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org