Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Starting Equinox service programmatically
Starting Equinox service programmatically [message #54946] Wed, 24 October 2007 08:01 Go to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi,

For automatic testing I want to start/stop the Equinox service
programmatically add/remove bundles at runtime, is it possible ?

Best Regards,

Setya
Re: Starting Equinox service programmatically [message #55353 is a reply to message #54946] Thu, 25 October 2007 07:02 Go to previous messageGo to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi,

I've got it working, for those insterested I followed this article :

http://www.eclipsezone.com/eclipse/forums/t93976.rhtml

Best Regards,

Setya
Re: Starting Equinox service programmatically [message #55870 is a reply to message #55353] Fri, 26 October 2007 14:17 Go to previous messageGo to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Setya wrote:

> I've got it working, for those insterested I followed this article :

> http://www.eclipsezone.com/eclipse/forums/t93976.rhtml

Sory, that article only tells how to install & start bundles as jars, when
I tried to install & start bundle as projects it throws the following
exception:

org.osgi.framework.BundleException: The activator
com.farbeyond.core.rap.CorePlugin for bundle com.farbeyond.core is invalid
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:141)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:962)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:317)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:256)
at com.farbeyond.core.test.TestCore.startTest(TestCore.java:84)
Caused by: java.lang.ClassNotFoundException:
com.farbeyond.core.rap.CorePlugin
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:402)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:347)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:278)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:134)
... 26 more
... Removed 22 stack frames

It complains about not being able to find the activator class, I don't
understand this since PDE does not complain about this and I can launch
through Equinox OSGI Framework without problems.

This how I install the bundle:

String[] args = new String[]{"-debug","-clean"};
BundleContext context = EclipseStarter.startup(args,null);
Bundle bundle =
context.installBundle("file:/home/setya/Projects/Farbeyond/JProjects+RAP/FBCore ")

bundle.start() //Exception thrown here.

Any ideas ?

Best Regards,

Setya
Re: Starting Equinox service programmatically [message #56018 is a reply to message #55870] Mon, 29 October 2007 03:06 Go to previous message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi,

> Sory, that article only tells how to install & start bundles as jars, when
> I tried to install & start bundle as projects it throws the following
> exception:

> org.osgi.framework.BundleException: The activator
> com.farbeyond.core.rap.CorePlugin for bundle com.farbeyond.core is invalid
> at
>
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:141)
> at
>
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:962)
> at
>
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:317)
> at
>
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:256)
> at com.farbeyond.core.test.TestCore.startTest(TestCore.java:84)
> Caused by: java.lang.ClassNotFoundException:
> com.farbeyond.core.rap.CorePlugin
> at
>
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:402)
> at
>
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:347)
> at
>
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
>
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:278)
> at
>
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
> at
>
org.eclipse.osgi.framework.internal.core.AbstractBundle.load BundleActivator(AbstractBundle.java:134)
> ... 26 more
> ... Removed 22 stack frames

> It complains about not being able to find the activator class, I don't
> understand this since PDE does not complain about this and I can launch
> through Equinox OSGI Framework without problems.

> This how I install the bundle:

> String[] args = new String[]{"-debug","-clean"};
> BundleContext context = EclipseStarter.startup(args,null);
> Bundle bundle =
>
context.installBundle("file:/home/setya/Projects/Farbeyond/JProjects+RAP/FBCore ")

> bundle.start() //Exception thrown here.

I've got it working now. It turns out I had to add 'Bundle-ClassPath:
bin/' in MANIFEST.MF. Now I have fully automatic unit testing.

Thanks.

Setya
Previous Topic:MessageDialog doesn't work!
Next Topic:Dialog setBlockOnOpen
Goto Forum:
  


Current Time: Tue Apr 23 14:59:14 GMT 2024

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

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

Back to the top