On 10/3/13 10:24 , Rajan Parthasarathy wrote:
Hello,

I'm running into an "Unresolved constraint in bundle" error, and hoping to get 
some insight into it. I'm using Felix system bundle 4.0.3.

The application uses an OBR, with a thread that periodically checks for 
updates. Bundles are updated using Resolver. Here's the code which performs the 
updates (with null checks, etc. removed):

             repositoryAdmin.addRepository(new URL(repositoryUrl));
             Resolver resolver = repositoryAdmin.resolver();
             Resource resource = ... get the resource we want to update ...
             resolver.add(resource);
             if (resolver.resolve(Resolver.NO_OPTIONAL_RESOURCES)) {
                 resolver.deploy(Resolver.NO_OPTIONAL_RESOURCES | 
Resolver.START);
             }

The application is running in Felix with the following bundles:
collector-api (0.2.2) - exports itself
collector-engine (0.2.10) - imports collector-api >= 0.2.2
port-watcher (0.2.2) - imports collector-api >= 0.2.0

I updated the OBR in the following manner:
- replaced collector-api 0.2.2 with collector-api 0.2.3
- replaced engine 0.2.10 with 0.2.11, which imports collector-api >= 0.2.3

When I resolve and deploy engine 0.2.11 with the above code, it throws the 
following error:
ERROR 2013-10-02 16:52:58.235 (org.apache.felix.bundlerepository:?) - Resolver: 
Start error - com.rapid7.razor.collector.engine
org.osgi.framework.BundleException: Unresolved constraint in bundle 
com.rapid7.razor.collector.engine [8]: Unable to resolve 8.29: missing requirement [8.29] 
osgi.wiring.package; 
(&(osgi.wiring.package=com.rapid7.razor.collector.api)(version>=0.2.3)(!(version>=1.0.0)))

If I replicate the above scenario without the port-watcher bundle installed, 
then it works - the engine gets updated successfully. Any hints as to what is 
happening here?

Not sure. There is code in OBR that tries to update a bundle instead of deploying a second version. Perhaps it tries to update collector-api to 0.2.3 but determines that it breaks the port-watcher dependency if it does that so it fails. If that is the case, then that would be a bug since it shouldn't fail, it should deploy a second version of collector-api.

When you run your example without port-watcher is the existing version of collector-api updated to 0.2.3 or are there two versions of the bundle deployed?

-> richard


Thank you,
Raj
This electronic message contains information which may be confidential or 
privileged. The information is intended for the use of the individual or entity 
named above. If you are not the intended recipient, be aware that any 
disclosure, copying, distribution or use of the contents of this information is 
prohibited. If you have received this electronic transmission in error, please 
notify us by e-mail at (postmas...@rapid7.com) immediately.


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



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

Reply via email to