You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Thomas Watson (JIRA)" <ji...@apache.org> on 2013/02/26 15:54:13 UTC

[jira] [Created] (FELIX-3934) osgi.identity capabilities from fragments can cause problems when resolving multiple fragments

Thomas Watson created FELIX-3934:
------------------------------------

             Summary: osgi.identity capabilities from fragments can cause problems when resolving multiple fragments
                 Key: FELIX-3934
                 URL: https://issues.apache.org/jira/browse/FELIX-3934
             Project: Felix
          Issue Type: Bug
          Components: Resolver
         Environment: All
            Reporter: Thomas Watson


If you are resolving multiple fragments against the same host at the same time then the osgi.identity capabilities provided by fragments can cause the wiring result to be miscalculated because a wrapped host is not used to populate the wires.  Here is a simple scenario:

Bundle-SymbolicName: A

Bundle-SymbolicName: F1
Fragment-Host: A

Bundle-SymbolicName: F2
Fragment-Host: A

Bundle-SymbolicName: B
Require-Capability: osgi.identity; filter:="(osgi.identity=F2)"

During the final phase of resolution when calling populateWireMap, if the first Resource target is B then it will cause a recursive call to populateWireMap using the raw resouce of F2 since it provides the identity capability required by B.  This ultimately will result in another recursive call to populateWireMap using the raw resource of A since it provides the host capability required by F2.  This is wrong, we must ensure only wrappedResources for the host of a resolving fragment resource are passed to populateWireMap.

All other namespaces besides osgi.identity are considered payload capabilities from fragments.  This results in proper wrapping of the capabilities provided by fragments which then results in proper calls to populateWireMap since capabilities coming from fragments will be properly wrapped with their hosting resource.  But in the case of osgi.identity no wrapping is done for the capability so we are left with the raw capability when resolving a required wire to the osgi.identity.  

I will provide a patch with a potential fix.  The fix is probably not the most elegant approach.  It basically spacial cases the osgi.identity namespace in the recursive call to populateWireMap to check if the providing resource is a fragment and if so then find the target wrapped host for proper calls to populateWireMap


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira