using the eclipse extension points in virgo

631 Views Asked by At

I am encountering a problem here...our team is trying to port an eclipse Eclipse RCP project into the web and so the first step is to try to use Virgo to use the plugins. I have created all the correct things but when I try to use an extension point (an Eclipse concept) it gives me a null pointer exception on this call:

org.eclipse.core.runtime.Platform.getextensionregistry(); // null here

Does anyone have any experience when it comes to solving this problem?

Thanks,

Tom

UPDATE:

So I got a little further with this. I've added the org.eclipse...registry bundle along with its associated bundles to the repository/usr folder and had to manually login to the console to start it up after I start up my web app. However this is still a problem because now my app doesn't seem to have any of the extension points registered. Could it be the sequence in which the app is started? (ie. I have to start the registry bundle first)?

1

There are 1 best solutions below

0
On

A first step would be to add the eclipse registry bundle to the initial artifacts for the user region; in org.eclipse.virgo.kernel.userregion.properties, change initialArtifacts to:

initialArtifacts=repository:plan/org.eclipse.virgo.kernel.userregion.blueprint,repository:plan
/org.eclipse.virgo.web.tomcat,repository:configuration/org.eclipse.virgo.apps.repository,repository:plan/org.eclipse.virgo.management,repository:bundle/org.eclipse.equinox.registry

This will at least ensure that the registry plugin is available while your eclipse plug-ins are being loaded. What I am still struggling with is figuring out how to control which plugin.xml are loaded by the registry and what triggers that. Somehow some eclipse runtime will scan some plugins directory, but how to set that up while in Virgo is still unclear to me.