Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Difference between an OSGi bundle as jar/directory
Difference between an OSGi bundle as jar/directory [message #121304] Wed, 19 November 2008 16:01 Go to next message
Eclipse UserFriend
Hi,

I have a question regarding the difference between deploying an OSGi
bundle as a jar and as a directory.

I have some OSGi bundles in a directory. In eclipse I change the "Target
Platform" to compile and run against this directory location (equinox
bundles are available there as well). The problem I am running into is
that if I supply my bundles as directories I will received compile errors
in my eclipse. The bundles are found but the exported packages can't be
discovered. If I jar my bundles (exactly same
structure/manifest/resources) and replace the directory bundles with those
everything is working fine.

Anybody got a hint for me?

Cheers
Philipp

PS: Some of the bundles need to be deployed as directories, so I can't
stick with the solution to jar everything up :-)
Re: Difference between an OSGi bundle as jar/directory [message #121334 is a reply to message #121304] Thu, 20 November 2008 09:00 Go to previous messageGo to next message
Danail Nachev is currently offline Danail NachevFriend
Messages: 110
Registered: July 2009
Senior Member
There shouldn't be difference between jar and folder bundles. Are you
sure they have exactly the same structure? Also, what are the exact
errors you are receiving:

PDE cannot resolve the packages in the manifest
Java compiler cannot find the classes to compile your classes



Philipp Marx wrote:
> Hi,
>
> I have a question regarding the difference between deploying an OSGi
> bundle as a jar and as a directory.
>
> I have some OSGi bundles in a directory. In eclipse I change the "Target
> Platform" to compile and run against this directory location (equinox
> bundles are available there as well). The problem I am running into is
> that if I supply my bundles as directories I will received compile
> errors in my eclipse. The bundles are found but the exported packages
> can't be discovered. If I jar my bundles (exactly same
> structure/manifest/resources) and replace the directory bundles with
> those everything is working fine.
>
> Anybody got a hint for me?
>
> Cheers
> Philipp
>
> PS: Some of the bundles need to be deployed as directories, so I can't
> stick with the solution to jar everything up :-)
>
Re: Difference between an OSGi bundle as jar/directory [message #121389 is a reply to message #121334] Fri, 21 November 2008 13:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

The PDE can resolve the bundles and the import packages (no error in the
Manifest) but the Java compiler (from within eclipse) can't "resolve the
import package".

The structure and content is both time exactly the same.


Cheers
Philipp
Re: Difference between an OSGi bundle as jar/directory [message #121405 is a reply to message #121389] Fri, 21 November 2008 14:27 Go to previous messageGo to next message
Danail Nachev is currently offline Danail NachevFriend
Messages: 110
Registered: July 2009
Senior Member
This most likely sounds like a bug and I suggest that you submit it to
the usual place [1] with detailed steps how it can be reproduced.

Before this, you can check the following things:

1) Are required bundles available In Plug-in Dependencies
2) What access rules have been set for the corresponding bundle (Project
Properties -> Java Build Path -> Libraries -> Plug-in Dependencies ->
<bundle> -> Access Rules

[1] https://bugs.eclipse.org/bugs/

Philipp Marx wrote:
> Hi,
>
> The PDE can resolve the bundles and the import packages (no error in the
> Manifest) but the Java compiler (from within eclipse) can't "resolve the
> import package".
>
> The structure and content is both time exactly the same.
>
>
> Cheers
> Philipp
>
Re: Difference between an OSGi bundle as jar/directory [message #121412 is a reply to message #121405] Fri, 21 November 2008 14:43 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

It doesn't show up in the dependencies section. Since I am using those
bundles as "Target Platform" is there a way to start eclipse with an
OSGI-console? Maybe this would reveal something (unresolved dependencies
within the Target Platform).

I don't think this is a bug (I rather think this is an error on my side
:-)). Funny thing is that I have some bundles which work as a directory
and some won't.

Cheers
Philipp
Re: Difference between an OSGi bundle as jar/directory [message #121449 is a reply to message #121412] Mon, 24 November 2008 16:04 Go to previous message
Danail Nachev is currently offline Danail NachevFriend
Messages: 110
Registered: July 2009
Senior Member
When you open the OSGi Framework launch configuration, in Bundles tab,
you can select Validate Bundles, which will resolve the bundles offline
(including those in your target platform) and report any problems found
before launching the framework.

Otherwise, you can add the following parameters to the command line:

-console -consoleLog

This will give you a console and also redirect any exceptions logged to
the console.

Philipp Marx wrote:
> Hi,
>
> It doesn't show up in the dependencies section. Since I am using those
> bundles as "Target Platform" is there a way to start eclipse with an
> OSGI-console? Maybe this would reveal something (unresolved dependencies
> within the Target Platform).
>
> I don't think this is a bug (I rather think this is an error on my side
> :-)). Funny thing is that I have some bundles which work as a directory
> and some won't.
>
> Cheers
> Philipp
>
Previous Topic:creating and using references
Next Topic:How Can a Bundle Start w/o the Calling Start Method
Goto Forum:
  


Current Time: Sat Apr 27 02:35:27 GMT 2024

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

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

Back to the top