Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Bundle Resolved before Fragment(Constraints from the fragment conflict with the host:)
Bundle Resolved before Fragment [message #933004] Thu, 04 October 2012 12:43 Go to next message
Thorsten Schlathölter is currently offline Thorsten Schlathölter
Messages: 208
Registered: February 2012
Location: Düsseldorf
Senior Member
Hi,
I have a problem with an OSGI fragment that does not resolve because of constraint issues. I have an RCP/RAP application that provides special fragments for RCP. These fragments add some jFreeChart based functionality which is not available in RAP. The RCP fragment adds new constraints to the bundle. Namely require a jFreeChart bundle.
Now I always get a warning:

Constraints from the fragment conflict with the host:


This is due to the fact that my fragment adds new constraints and the fragment is resolved at a time where the bundle already has been resolved. This is by osgi specification not allowed.
This is the documentation of the code that actually adds the resolve error (ResolverBundle.constraintsConflict()):

// this method iterates over all additional constraints from a fragment
// if the host is resolved then the fragment is not allowed to add new constraints;
// if the host is resolved and it already has a constraint of the same name then ensure the supplier satisfies the fragment's constraint


On the other hand I have found the following information in an IBM Rational Software documentation:

 Fragments are treated as part of the host bundles. Relevant definitions of the fragment are merged with the host bundles definitions before the host is resolved, as long as the information does not conflict.


So it seems to me that actually host and fragment could/should be resolved at the same time allowing the fragment to add new constraints.
Like I said: In my case the bundle is resolved before the fragment. I don't know why and I don't know how to control this. Can anybody tell me if I am using a wrong approach?

I don't know if this is important but gemini blueprint is part of my target platform.

Any hints would be appreciated.

Regards,
Thorsten
Re: Bundle Resolved before Fragment [message #933220 is a reply to message #933004] Thu, 04 October 2012 17:12 Go to previous message
Thorsten Schlathölter is currently offline Thorsten Schlathölter
Messages: 208
Registered: February 2012
Location: Düsseldorf
Senior Member
Hours of frustating debugging in the org.eclipse.osgi bundle it finally turns out that this seems to be some kind of cached problem. After manual deletion of

eclipse_workspaces\workspace_rcp\.metadata\.plugins\org.eclipse.pde.core\MYAPP\org.eclipse.osgi\*


The bundle is resolved together with the respective plugin and everything works just fine.

Regards,
Thorsten
Previous Topic:How to add context sensitive help to Import Wizard
Next Topic:Undo command description
Goto Forum:
  


Current Time: Wed Aug 20 08:57:56 EDT 2014

Powered by FUDForum. Page generated in 0.01404 seconds