Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Managing Your Target Platform with Virgo Tooling
Managing Your Target Platform with Virgo Tooling [message #967540] Thu, 01 November 2012 21:07 Go to next message
Dave Dresser is currently offline Dave DresserFriend
Messages: 7
Registered: April 2010
Junior Member
Software
Eclipse Juno SR 1 20120920-0800
Virgo 1.0.0.201209050002-RELEASE

I'm embarking on a project to move an product built with Eclipse PDE to Virgo. Previously we built our own target platform folder with an ant script and P2. Now it seems with Virgo Tooling that the target platform is implicitly defined by defining your Virgo Server and associating it with your Bundle Project. At first I imported our existing PDE projects and then added the 'OSGI Bundle Project Nature' to them. I was running into lots of issues resolving dependencies so I deleted all the projects and defined a new Bundle Project. I'm adding classes one by one from the old PDE project to the new Bundle Project. I'm running into two issues. First my Virgo server seems to have two locations for resolving dependencies, the usr and ext folders in the repository. As I run into an external dependency I've been copying the bundle to the usr folder of the repository. This seems to work fine for resolving dependencies but I don't know how to force Eclipse to refresh after adding new bundles to the folder. They seem to show up after quite awhile but I don't know what triggers Eclipse into recognizing that there are new bundles in the Virgo repository. Second I'm unable to resolve packages exported by org.eclipse.osgi and am wondering what is the best way to fix that.

So I have three questions:


    Is there a way to convert PDE projects to Bundle projects?
    Is there a way to refresh Eclipse's view of Virgo's repository folders.
    I'm not finding packages exported from the org.eclipse.osgi bundle. It is present in Virgo's plugins directory but that is not exposed via the Virgo Server definition. What is the best way to pick up those exports.
Re: Managing Your Target Platform with Virgo Tooling [message #984840 is a reply to message #967540] Thu, 15 November 2012 01:25 Go to previous messageGo to next message
Leo Dos Santos is currently offline Leo Dos SantosFriend
Messages: 26
Registered: July 2009
Junior Member
Hello Dave

Quote:
Is there a way to convert PDE projects to Bundle projects?

Unfortunately there is no tool that will quickly do this for you. You'll have to take one of the approaches you've already described.

Quote:
Is there a way to refresh Eclipse's view of Virgo's repository folders.

Yes, there's a couple of ways. You can open the Virgo Repository view and hit the refresh button in the Repository view tool bar, or you can open the server editor for your Virgo runtime and in the Repository page you can hit the Refresh button next to the Bundles and Libraries table. This will refresh Eclipse's knowledge of your Virgo repository. If your bundle projects don't pick up the additions right away, you can right-click the project and select the Refresh Bundle Classpath Container item from the Virgo menu.

Quote:
I'm not finding packages exported from the org.eclipse.osgi bundle. It is present in Virgo's plugins directory but that is not exposed via the Virgo Server definition. What is the best way to pick up those exports.

As far as I'm aware, the plugins directory contains bundles necessary for the Virgo server to function and aren't necessarily included for reuse. The tools won't look for bundles in the plugins directory but will look in the repository subdirectories. So if you need org.eclipse.osgi you'll have to copy it to repository/ext or repository/usr

Hope that helps
- Leo

[Updated on: Thu, 15 November 2012 01:26]

Report message to a moderator

Re: Managing Your Target Platform with Virgo Tooling [message #985942 is a reply to message #984840] Fri, 16 November 2012 19:06 Go to previous messageGo to next message
Dave Dresser is currently offline Dave DresserFriend
Messages: 7
Registered: April 2010
Junior Member
Thanks, I was able to see a refreshed repository from the Virgo Repository view after refresh. However, I'm having other issues with the tooling. I decided this morning to start with a fresh workspace and create two simple bundles called producer and consumer. The producer bundle exports an api with a method that returns a string. The consumer will depend on the producer bundle and call the producer method to get the string.
    I created the producer bundle project, added an activator, and added org.eclipse.osgi to repository/usr to resolve the reference to BundleActivator. The producer bundle now built without errors and I was able to start the server and see the producer bundle deployed and started in the console.

    I created the consumer bundle project and tried to add a reference to the API exported by the producer. However the consumer project can't resolve the reference. If I open the manifest editor and select the Dependencies tab and click add on the Import Package section, I can see all the bundles from the server repository but not the producer bundle. So I thought, I guess I have to place the producer bundle into repository/usr for the consumer project to see it. Now even though the server starts and deploys the producer bundle that bundle is not placed in repository/usr.

    From the Servers view I tried right mouse click and Publish on the server and right mouse click and redeploy on the producer bundle but neither will get me a copy of the producer bundle in repository/usr. Several times during this process I tried to right mouse click on the server in the Servers view and select open. However, each time I did that Eclipse would hang with a jvm crash. So I ran check for updates and installed the suggested EPP 1.5.1 package. I tried to open the server again after the update and again Eclipse hung with a jvm crash. Next I thought that I should just export the bundle into the repository.

    So from the project explorer I right mouse clicked on the producer project and selected Export. Not thinking to check the new Virgo menu and following my old habits, I selected Plug-in Development -- Deployable plug-ins and fragments. However my project was not available for export. I had read this previous post and thought I'll add PDE plugin natures to my project and I'll be able to use those tools. So I edited the project and added
    		<buildCommand>
    			<name>org.eclipse.pde.ManifestBuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    		<buildCommand>
    			<name>org.eclipse.pde.SchemaBuilder</name>
    			<arguments>
    			</arguments>
    		</buildCommand>
    ...
    		<nature>org.eclipse.pde.PluginNature</nature>
    
    
    I restarted eclipse. This didn't help with being able to export my project as a Deployable plug-in. The project was still not available for selection. However, since I did this I've been able to open the server from the servers view without Eclipse crashing.

    Then after all this I thought about the Virgo menu and exported the producer project to the repository. This resolved my references in the consumer project and I was able to build and run the server. The console showed both bundles deployed and started.

    Just to verify I edited the producer project and removed the PDE nature and build specs so that the project looked like the consumer project which I never messed with. I restarted eclipse and tried to open the server in the Servers view and Eclipse hung with the jvm crash.

Is there a way to push the bundles into the repository other than Export-->Virgo-->Bundle Project?
Re: Managing Your Target Platform with Virgo Tooling [message #989317 is a reply to message #967540] Wed, 05 December 2012 15:59 Go to previous message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 61
Registered: July 2009
Member
Hi Dave,

you may want to have a look at a little plug-in I wrote that allows developing for Virgo using PDE tools and PDE plug-in projects.

Have a look here:
http://devshards.blogspot.it/2012/10/developing-for-virgo-server-with.html
https://github.com/giamma/pde2virgo/


Developing for Virgo using PDE: http://bit.ly/1w0tTit
Global JNDI in Virgo: http://bit.ly/1to42mn
Hyperic to monitor Virgo: http://bit.ly/W1Fst9
Profile Virgo with JProfiler http://bit.ly/1FBLGCw
Previous Topic:Fat client remoting with Virgo
Next Topic:Table LISTING not found in greenpages example
Goto Forum:
  


Current Time: Mon Dec 22 05:41:22 GMT 2014

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

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