Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Use of plain old Eclipse Plugins with Virgo Tooling(Unable to load manifest either in Virgo Server or Eclipse Launcher)
Use of plain old Eclipse Plugins with Virgo Tooling [message #872469] Wed, 16 May 2012 03:28 Go to next message
Thorsten Schlathölter is currently offline Thorsten Schlathölter
Messages: 207
Registered: February 2012
Location: Düsseldorf
Senior Member
Hi,
I wonder if it is by some chance possible to use plain old eclipse plugin bundles within virgo tooling?

Background: I have an RCP application that communicates with a database via a server layer installed in a tomcat. I have some common code that is used on both sides, client and server. In order to run this code on RCP it is wrapped in a simple Eclipse plugin bundle.

Now I would like to OSGI-ify the server component and I need to run these eclipse plugin bundles as OSGI bundles in the Virgo server. Of course this works when I use a compiled bundle and drop it into the virgo repository. The problem arises when I try to use this bundle using virgo tooling from within eclipse.
I have tried to add the OSGI Bundle nature to the respective plugin project. This enables me to add the plugin to an OSGI Plan Bundle. But if I start the server I get an exception indicating that the manifest is not available.

[2012-05-16 08:52:55.420]  TCP Connection(6)-127.0.0.1 <DE0002E> Installation of par 'TestWS.par' version '1.0.0' failed. java.lang.UnsupportedOperationException: Cannot open an input stream for 'C:\Programme_wa\virgo\virgo-tomcat-server-3.0.3.RELEASE\work\org.eclipse.virgo.kernel.deployer_3.0.3.RELEASE\staging\TestWS.par-1\bundle\TestWS.par-1-TestEclipsePlugin\0.0.0\TestEclipsePlugin.jar\META-INF\MANIFEST.MF' as it does not exist


I noticed that within the OSGI Bundles the META-INF/Manifest.mf is always part of a source folder whereas in eclispe plugins, the META-INF/Manifest is always located in the plugin-root. If I move the META-INF folder into a source folder, the bundle is started correctly in virgo but in that case the eclipse plugin is not recognized from the eclipse application launcher any more.

Has anybody a solution for this?

Regards,
Thorsten
Re: Use of plain old Eclipse Plugins with Virgo Tooling [message #872689 is a reply to message #872469] Wed, 16 May 2012 11:52 Go to previous messageGo to next message
Miles Parker is currently offline Miles Parker
Messages: 1338
Registered: July 2009
Senior Member
Hi Thorsten,

That's what 329198: Support PDE/Equinox bundles in Eclipse IDE
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329198 is all about. Smile

See especially discussion around OSGi bundle support. My feeling is that you shouldn't have to do anything to an Eclipse plugin to make it deployable to Virgo, but we don't yet have the mechanism for that. I'm not sure when we'll be able to get to this, but it's definitely on the radar.

cheers,

Miles
Re: Use of plain old Eclipse Plugins with Virgo Tooling [message #874622 is a reply to message #872689] Mon, 21 May 2012 05:15 Go to previous messageGo to next message
Thorsten Schlathölter is currently offline Thorsten Schlathölter
Messages: 207
Registered: February 2012
Location: Düsseldorf
Senior Member
Thanks for the info Miles,
I have recently read your great article on "EMF and RAP and Virgo, oh my.." which explains my last weeks working life in astonishing detail. To be honest I was a little delighted by the fact that others have exactly the same experience when exploring new eclipse terrain. For the last couple of weeks I was trying to get my feet wet on server side OSGI and I have tried all kinds of things from equinox ServletBridge, Spring DM and Virgo. Always thinking that the end is near. The Virgo installation is currently the end of my personal rainbow. After getting the greenpages example running, I again thought that I had almost made it Smile.
Now again dark clouds arise at the horizon.... But I will keep on "walking my rainbow". There is a solution out there. It just has to be found. Hope to be back early from work in the near future.

Regards,
Thorsten
Re: Use of plain old Eclipse Plugins with Virgo Tooling [message #875483 is a reply to message #874622] Tue, 22 May 2012 16:31 Go to previous messageGo to next message
Thorsten Schlathölter is currently offline Thorsten Schlathölter
Messages: 207
Registered: February 2012
Location: Düsseldorf
Senior Member
Finally I "solved" this issue by declaring an xml builder that copies the META-INF\MANIFEST.MF into the bin folder.
This is not very practical because the builder is for sure only executed when the project is build. (I have got to admit that I never used an external builders before, so maybe I am missing something). But at least it works. If somebody tries this, make sure that you tell the builder to refresh the bin folder after completion. For plugins that make use of the Virgo BundleClasspathContainer (org.eclipse.virgo.ide.jdt.core.MANIFEST_CLASSPATH_CONTAINER) it is important to note that this container only works if the META-INF folder is located in a source folder. So in this case the META-INF folder might have to be copied from the source folder to the root of the plugin (I have not yet tried that).

I assume that this is only a temporary work around until the bug gets fixed.

Regards,
Thorsten

[Updated on: Tue, 22 May 2012 16:33]

Report message to a moderator

Re: Use of plain old Eclipse Plugins with Virgo Tooling [message #875602 is a reply to message #875483] Tue, 22 May 2012 22:13 Go to previous messageGo to next message
Miles Parker is currently offline Miles Parker
Messages: 1338
Registered: July 2009
Senior Member
Glad you liked the article Thorsten! I had fun writing it and yes, that seems to be my experience with almost every new Eclipse technology. I do think Virgo is one of the more pleasant journeys I've taken, but it definitely isn't worry free.

WRT to the issue of manifests, what it should come down to is whether or not the MANIFEST.MF appears in the built class path. The following "should" always work:

1. Manually copy all of the dependencies to say your Vigo /repository/usr directory.
2. Export your plugin using the built-in PDE tools.
3. Manually copy that plugin to the directory above.
4. Create a plan file that references 1 and 2 above.

But it seems that you're needing this extra step of manually adjusting the build results and that doesn't seem to me that it should be neccessary. It sounds to me like the real issue might be your plugin project setup. You might compare it to another "off the shelf" Eclipse plugin project that does seem to work correctly. But OTOH I may be wandering around in the forest here. Smile

cheers,

Miles

Re: Use of plain old Eclipse Plugins with Virgo Tooling [message #875810 is a reply to message #875602] Wed, 23 May 2012 07:05 Go to previous messageGo to next message
Thorsten Schlathölter is currently offline Thorsten Schlathölter
Messages: 207
Registered: February 2012
Location: Düsseldorf
Senior Member
Just to get this straight in case somebody has similar problems or I am missing some major thing here. Prior to opening this posting I had indeed figured out that

1. Manually copy all of the dependencies to say your Vigo /repository/usr directory.
-> works
2. Export your plugin using the built-in PDE tools.
-> works
3. Manually copy that plugin to the directory above.
-> works
4. Create a plan file that references 1 and 2 above.
-> works

But I needed a server which I could use from within eclipse. For example for debugging purposes. I thought that the Virgo Server together with the Eclipse Virgo Tooling Extension should be able to accomplish this. So I installed all necessary tooling bundles as described in the Virgo documentation. I added a Virgo Server within the Eclipse Server-View. I published the greenpages example to that server. The example works more or less fine. After that I tried to get my own bundles running in Virgo. These bundles were setup to run from an Eclipse Launcher as an OSGI Framework (which works just fine). So from the beginning all these bundles were orginal eclipse plugin bundles with the respective nature etc. In order to prepare for Virgo, I added the Virgo Bundle feature to all respective plugins. This enabled me to deploy the bundles to my Virgo server. But when I finally published this setup to the Virgo server, I got the error stated in my original posting, indicating that the Manifest.mf was missing.
To my understanding the reason is that Virgo "publisher" looks for resources and binaries only in the bin folder of the plugin whereas the Eclipse "launcher" also looks in the plugin root. Even with a virgin like Eclipse Plugin I have the same problem. The project builder for an eclipse plugin always puts the META-INF folder in the root of the plugin whereas the OSGI Bundle project builder always puts it into a source folder. Since the java builder always copies all resources from source folders into the bin folder, the META-INF folder is present in the bin folder for OSGI Bundles but not for Eclipse Bundles.

To come to an end. Even after extensively exploring eclipse vegetation I do not see any problem in my project setup. The workaround via the external builder is just a vehicle to get this thing running. I hope there will be an out of the box solution for a plugin bundle structure in near future.

Regards,
Thorsten
Re: Use of plain old Eclipse Plugins with Virgo Tooling [message #875928 is a reply to message #875810] Wed, 23 May 2012 11:12 Go to previous message
Miles Parker is currently offline Miles Parker
Messages: 1338
Registered: July 2009
Senior Member
OK, got it. Sorry, this thread turned out to be a bit circular. Yes, we do not yet support that. And we should. Smile
Previous Topic:log cookies
Next Topic:Scoped plan with EclipseLink runs into problems
Goto Forum:
  


Current Time: Thu Apr 24 14:43:30 EDT 2014

Powered by FUDForum. Page generated in 0.01668 seconds