Question on starting Equinox from Java Application [message #100312] |
Thu, 25 October 2007 07:33 |
|
Hi all,
I've followed tutorial
http://www.eclipsezone.com/eclipse/forums/t93976.rhtml to enable me to
start Equinox programmatically (Thanks Alex). I have the following
questions :
1. One of my bundles (Jetty) needs a parameter that tells it to open at
the specified port. When I launch Equinox from Eclipse I only have to put
"-Dorg.osgi.service.http.port=8080" at the VM arguments section. How do I
pass the parameter through code ?
2. One of my bundles actually points to an Eclipse plugin project that's
not jarred yet. Since installBundle method apparently expects url that
points to jar files, how do I tell Equinox to install this bundle ?
3. Since starting this Equinox takes place on startup method of a TestCase
class, do I have to call each bundle's stop method on teardown method or
is just calling EclipseStarter.shutdown enough ?
Any help would be greatly appreciated.
Best Regards,
Setya
|
|
|
Re: Question on starting Equinox from Java Application [message #100327 is a reply to message #100312] |
Thu, 25 October 2007 10:38 |
|
Hi all,
> 2. One of my bundles actually points to an Eclipse plugin project that's
> not jarred yet. Since installBundle method apparently expects url that
> points to jar files, how do I tell Equinox to install this bundle ?
For question #2 I've tried the following code:
bundle = context.installBundle("reference:file:<path to my project>")
but then it throws ClassNotFoundException exception stating that it can
not find my activator class.
Any ideas ?
Regards,
Setya
|
|
|
|
|
Re: Question on starting Equinox from Java Application [message #100411 is a reply to message #100385] |
Fri, 26 October 2007 13:47 |
|
Hi,
Thanks for your response.
> That would indicate that it installed correctly and found the Manifest fine
> but it couldn't find your Activator's class.
> I'd check your bundle classpath and double check the location of your class
> files.
This is weird, I have no problem running it from PDE and all dependencies
are satisfied.
> The other possibility is that you're getting a misleading CNF exception
> because a dependency of your Activator is not being found. In that case I
> would attach a debugger.
From the stacktrace it's clearly trying to load my bundle activator and
failed.
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:83)
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
Any ideas ?
Regards,
Setya
|
|
|
|
Re: Question on starting Equinox from Java Application [message #100484 is a reply to message #100424] |
Mon, 29 October 2007 02:59 |
|
Hi,
> Hmm... if I had to guess.
> Did you export your bundle?
> When you run under PDE /bin is automagically added to your bundle-classpath.
Yes, you guess right.
After I add 'Bundle-ClassPath: bin/' in the MANIFEST.MF through PDE it
works as expected.
Thank you very much for your help.
Regards,
Setya
|
|
|
|
Powered by
FUDForum. Page generated in 0.02233 seconds