Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » PDE OSGi bundles and Virgo tooling(Shouldn't both tools use that same basis?)
icon5.gif  PDE OSGi bundles and Virgo tooling [message #1729645] Sat, 16 April 2016 21:28 Go to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
I've been doing OSGi in eclipse for a while now and decided to try out Virgo as an application server.

The eclipse tooling was one of the things that really caught my eye, the thought of being able to do OSGi development the same way that I can do Servlet, JSP, etc., with publishing to a server was really appealing.

I falsely assumed that my current pallet of OSGi bundles would seamlessly integrate with the Virgo runtime using the provided tooling.

I'm used to define "OSGi Frameworks" and being able to simply select the bundles that I want to include, so eclipse obviously "knows" which "Plug-In projects" are OSGi compliant bundles.

When I deployed a few bundles to Virgo everything was getting messed up. Bundle version "0.0.0" everywhere, no classes being found etc..

It took me for ever to figure out that the Virgo tooling expects "META-INF/MANIFEST.MF" to be in a source directory and doesn't care about the PDE file. I thought I didn't understand either the tooling, Blueprints or Virgo.

You can imagine my surprise when I decided to try copying "META-INF/MANIFEST.MF" to the source directory and everything started working as I had expected it to from the beginning.

The PDE has "META-INF/MANIFEST.MF" in the root directory of the project and this is not configurable. Other bundles in the PDE look there for Required-Bundles and Exported-Packages and everything develops and runs "out of the box".

Why does there have to be an extra "org.eclipse.virgo.ide.facet.core.bundlenature" nature that describes the same thing anyway?

Would it be too much to ask for the Virgo tooling to check if the project has the "org.eclipse.pde.PluginNature" nature and then copy "META-INF/MANIFEST.MF"" from the project root when deploying? Maybe with a "org.eclipse.virgo.ide.facet.core.pdebundlenature" marker if it has to be a manual selection.

Doing this would present a unified use of OSGi bundles to us developers and the thought of being forced to have a redundant copy of "META-INF/MANIFEST.MF"" in a source directory just for Virgo deployment is an awful thought.

References:

Open bug since 2006 - Expose flexible bundle root location in bundle creation wizards: https://bugs.eclipse.org/bugs/show_bug.cgi?id=153023

Open bug since 2010 - Support PDE/Equinox bundles in Eclipse IDE: https://bugs.eclipse.org/bugs/show_bug.cgi?id=329198
Re: PDE OSGi bundles and Virgo tooling [message #1729653 is a reply to message #1729645] Sun, 17 April 2016 07:44 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 57
Registered: November 2015
Member
Hi Bill,

the bugzilla entry you reported has been recently updated as you can see in comment #50 [1].

The Virgo Tools 1.5 snapshot that you can install from the snapshot update site [2] contain the first implementation of PDE support for Virgo.
Unluckily documentation is not yet ready. High-level usage flow is sketched in [1].

The key points are that:


  1. You create a new Virgo Server. While doing so, you first create a new Virgo Runtime and in the last page of the runtime wizard you enable PDE support via check-box ("Enable development using Eclipse PDE tools"). The wizard will then read your Virgo repository configuration and eventually setup a PDE target platform definition from that.
  2. Because a PDE target platform is associated to the Runtime of the newly created Virgo Server, the Virgo Server icon will be decorated in the Server View in the top-left with a small "runtime globe".
  3. You can now create PDE projects for Virgo. This cannot be done using the standard Plug-in Project wizard but must be done via a dedicated PDE wizard in the Virgo category of wizards. Once created, the project icon will also be decorated with a "runtime globe" in the top-left (New -> Virgo -> PDE Bundle project)


After doing the above steps you will be able to add/remove the project from the server and to develop using the PDE tools.
If you add content to the target platform via file system, reload it as usual or via the dedicated link in the Virgo Server Editor.
If you need to make structural changes to the target platform (e.g. add folders) you can do this either via it's preferences page or via a simplified dialog from the Virgo Server Editor. The latter has the advantage that the changes will be applied to the Virgo repository properties file as well.

Support for PDE in Virgo Tools is brand new and there may be defects. Feel free to ask support in the forum or report defects in bugzilla.
At the same time, the the 1.5.0 snapshot builds have been happily used by myself and some colleagues of mine for some weeks on Windows and Linux and seem to be good enough for everyday use.

Hope this helps.
GianMaria.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=329198#c50
[2] http://download.eclipse.org/virgo/snapshot/tooling
Re: PDE OSGi bundles and Virgo tooling [message #1729657 is a reply to message #1729653] Sun, 17 April 2016 08:20 Go to previous messageGo to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
Hi GianMaria,

I didn't get as far as comment 50 but I'm using Mars (4.5.2) so I already have the snapshot installed.

The CheckBox is set in my server configuration, I've added the "OSGi Bundle Nature" and I've ran "Migrate PDE2Virgo Project".

The end result is the same, the MANIFEST.MF in the Project's /META-INF is ignored.

I didn't add one of the "OSGi Framework" run times because the platform has that many and I don't want them all in the Virgo server.

So the solution doesn't work for me.

I don't understand why is it should be so difficult to have the MANIFEST.MF taken from the PDE project's META-INF directory.

I found a workaround that gets the deploy working correctly. I've created a META-INF directory in SRC and then added a linked resource to the project's MANIFEST.MF.

.project then has this added:
        <linkedResources>
                <link>
                        <name>src/META-INF/MANIFEST.MF</name>
                        <type>1</type>
                        <locationURI>PROJECT_LOC/META-INF/MANIFEST.MF</locationURI>
                </link>
        </linkedResources>


This doesn't seem to break the release builds or my ant scripts as the file isn't physically copied.
Re: PDE OSGi bundles and Virgo tooling [message #1729666 is a reply to message #1729657] Sun, 17 April 2016 12:19 Go to previous message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 57
Registered: November 2015
Member
Hi Bill,

I believe from your comment in the other discussion [1] that it finally worked for you.
We should probably merge the two topics together but I don't know whether it's possible with this forum software.

GianMaria.

[1] https://www.eclipse.org/forums/index.php?t=msg&th=1076606&goto=1729658&#msg_1729658
Previous Topic:Bundle-NativeCode selection-filter not properly supported
Next Topic:VIRGO -NANO 3.6.4 Tomcat version
Goto Forum:
  


Current Time: Thu Apr 25 13:52:56 GMT 2024

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

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

Back to the top