Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » EclipseRT-OSGi-StarterKit Vs equinox-SDK
EclipseRT-OSGi-StarterKit Vs equinox-SDK [message #743730] Fri, 21 October 2011 17:44 Go to next message
pearl  is currently offline pearl Friend
Messages: 2
Registered: October 2011
Junior Member
Hi,

I am developing a web application and trying to deploy it in Equinox. To start with I developed my application (using Plug-in Development) in Eclipse and deployed my bundle using Eclipse "OSGi Framework" run configuration, it work perfectly fine.

Then I wanted to deploy my bundle in a stand alone Equinox so I downloaded "equinox-SDK-3.7.1" extracted it and added my bundle and other necessary bundles to the "config.ini" file and started Equinox, but my bundle fails to start and it throws the error "ClassNotFoundException: javax.naming.InitialContext"

Then I downloaded "EclipseRT-OSGi-StarterKit-3.7.1-win32-win32-x86_64.zip" and deployed my bundle in EclipseRT it works fine.

I am not sure why I am getting the error "ClassNotFoundException: javax.naming.InitialContext" when I try to install my bundle in a stand alone Equinox and what is the difference between EclipseRT-OSGi-StarterKit Vs equinox-SDK.

Please help me understand.

Re: EclipseRT-OSGi-StarterKit Vs equinox-SDK [message #743928 is a reply to message #743730] Fri, 21 October 2011 20:48 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 437
Registered: July 2009
Senior Member
See message http://www.eclipse.org/forums/index.php/mv/msg/208620/668355/#msg_668355 for a similar topic. It depends on how you are launching equinox. If you are using the standard OSGi launching APIs or simply launching with java -jar org.eclipse.osgi... then a compatibility option (osgi.compatibility.bootdelegation) is disabled by default. When this option is enabled then bundle class loaders get access to all things from the boot class loader as a last effort delegation.

The best practice in OSGi is that bundles should import all non-java.* packages that they use with Import-Package. This includes the package javax.naming.

HTH

Tom.
Re: EclipseRT-OSGi-StarterKit Vs equinox-SDK [message #752988 is a reply to message #743928] Wed, 26 October 2011 15:43 Go to previous message
pearl  is currently offline pearl Friend
Messages: 2
Registered: October 2011
Junior Member
Thanks Tom. I can clearly see that I am missing some basics here.. Smile

When I got the "ClassNotFoundException: javax.naming.InitialContext" I was starting with the following command
java -jar org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar -console
and I also add the "javax.naming" listed in the "org.osgi.framework.system.packages" of config.ini

If I start equinox as follows, I don't get the ClassNotFoundException and every thing works fine

java -jar org.eclipse.equinox.launcher_1.2.0.v20110502.jar -console


Tom can you please point me to some docs that I can read and understand more about what is going on here.
Previous Topic:Eclipse p2 Update Issue
Next Topic:[cm] ManagedServiceFactory.update(...) called multiple times with same configuration
Goto Forum:
  


Current Time: Fri Dec 19 04:38:10 GMT 2014

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

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