Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » [Solved]Help with import-package
[Solved]Help with import-package [message #663200] Mon, 04 April 2011 09:51 Go to next message
Tidus is currently offline TidusFriend
Messages: 16
Registered: March 2011
Junior Member
Hello,

I have a problem when resolving dependency with à plugin. I have this error:
An Import-Package could not be resolved. Caused by missing constraint in bundle <org.eclipse.equinox.p2.metadata.repository_1.1.0.v20100513>
             constraint: <Import-Package: org.eclipse.equinox.internal.p2.core.helpers; version="0.0.0">


After some search, i found in the user guide that it's a library dependency problem (http:// www.eclipse.org/virgo/documentation/virgo-documentation-3.0. 0.x/docs/virgo-programmer-guide/html/ch04s07.html). However I don't understand how to solve it.

Could you help me?

Moreover, is there a way to solve quickly dependency?

Thanks a lot Smile

[Updated on: Sun, 10 April 2011 12:46]

Report message to a moderator

Re: Help with import-package [message #663215 is a reply to message #663200] Mon, 04 April 2011 11:17 Go to previous messageGo to next message
Hristo Iliev is currently offline Hristo IlievFriend
Messages: 156
Registered: May 2010
Location: Sofia, Bulgaria
Senior Member

In any case you will have to find the bundle that provides the needed package (as there may be more than one bundle that provides some functionality). Seems you need the org.eclipse.equinox.p2.core bundle, but there may be imports that are missing.

You can use the Virgo Tooling to help you search in EBR and test the application:
http://www.eclipse.org/virgo/documentation/virgo-documentati on-2.1.0.RELEASE/docs/virgo-programmer-guide/html/ch07s03.ht ml

If the bundle is not available in EBR however you will need to manually provide it in Virgo's repository/usr directory and try to use (or just start) the bundles you need. When you have everything working you may want to move the bundles to repository/ext and restart Virgo with "-clean" option.

Eclipse provides the launch configuration editor. You can use it to have automatically selected all the needed dependencies and then copy them to repository/usr to test you application. The drawback is that if the bundles you use are not included in the Eclipse distribution you will have to define target platform to specify external location (P2 repository) as well.
Re: Help with import-package [message #663354 is a reply to message #663215] Mon, 04 April 2011 18:20 Go to previous messageGo to next message
Tidus is currently offline TidusFriend
Messages: 16
Registered: March 2011
Junior Member
Thanks for your answer.

Quote:
Eclipse provides the launch configuration editor. You can use it to have automatically selected all the needed dependencies and then copy them to repository/usr to test you application. The drawback is that if the bundles you use are not included in the Eclipse distribution you will have to define target platform to specify external location (P2 repository) as well.


Could you explain this step more?
Maybe can I explain my problem more?

I just wanted to expose an operation (we call it B) provided by a plugin (we call it A).
However, plugin A has dependency I want to solve.

There is my problem.
And now I try to understand what you try to explain to me Smile

[Updated on: Mon, 04 April 2011 19:11]

Report message to a moderator

Re: Help with import-package [message #663383 is a reply to message #663354] Mon, 04 April 2011 20:00 Go to previous messageGo to next message
Hristo Iliev is currently offline Hristo IlievFriend
Messages: 156
Registered: May 2010
Location: Sofia, Bulgaria
Senior Member

I guess you simply use Import-Package and not Import-Bundle or Import-Library?

If so then this problem looks like a missing bundle / package.

Exposing operation B requires that bundle A functions correctly. To ensure this you will have to provide all the needed packages. The packages needed for A to work as expected can be found in the META-INF/MANIFEST.MF of the bundle. In your case this seems to be "org.eclipse.equinox.p2.metadata.repository".

The imported packages may in turn import another package to perform the requested operation. This means that if we have the chain:

B --[imports]--> A --[imports]--> X --[imports]--> Y

then to have B working you will need A, X and Y.

You can check this post in my blog for a short tutorial how to use the Dependency Analysis in Eclipse to quickly find all the needed bundles.

In fact not all of them may be needed for a certain operation (namely B), but you will either have to find this by yourself or simply grab all the bundles.
Re: Help with import-package [message #664126 is a reply to message #663200] Thu, 07 April 2011 14:50 Go to previous message
Tidus is currently offline TidusFriend
Messages: 16
Registered: March 2011
Junior Member
First great thanks for your howto very instructive Smile Thumbs Up

I have another question directly linked to the previous: I tried to create a bundle.
In its dependency, I had a package which is in Virgo/usr.

I deployed the bundle to Virgo.
However, Virgo says that It can find dependency I defined.
What do I forget?

EDIT: I finally found the problem, I forgot a dependency.

[Updated on: Sun, 10 April 2011 12:46]

Report message to a moderator

Previous Topic:[Resolved] Require-Bundle could not be resolved
Next Topic:Continous Integration
Goto Forum:
  


Current Time: Thu Dec 05 17:31:25 GMT 2024

Powered by FUDForum. Page generated in 0.03021 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top