users@grizzly.java.net

Re: Running grizzly-servlet-webserver-1.8.0.jar in nOSGI environment

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 27 Jun 2008 16:04:07 -0400

Salut,

techi_amol wrote:
> Hi all,
>
> No rule change as far as i know. To make sure I checked using the "packages"
> command on the osgi prompt, it did recognize javax.management as a system
> package. Below is the detail that the packages command printed out
>
> javax.management; version="0.0.0"<System Bundle [0]>
> System Bundle [0] imports
>
> initial_at_reference:file:plugins/org.eclipse.update.configurator_3.2.100.v20070322.jar/
> [15] imports
>
> Maybe you can try to reproduce this. I am running osgi using
> org.eclipse.osgi_3.3.0.200704022148.jar. My dir structure looks like this
> equinox-osgi-runtime
> \configuration\config.ini
> \plugins\org.eclipse.equinox.common_3.3.0.200704022148.jar
> \plugins\org.eclipse.equinox.registry_3.3.0.v20070318.jar
> \plugins\org.eclipse.osgi.services_3.1.100.200704022148.jar
> \plugins\org.eclipse.update.configurator_3.2.100.v20070322.jar
>
>
> ################################################
> #############contents in the config.ini ##################
> ################################################
> #Eclipse Equinox Runtime Configuration File
> osgi.bundles=./plugins/org.eclipse.equinox.common_at_2:start,
> ./plugins/org.eclipse.update.configurator_at_3:start,
> ./plugins/org.eclipse.equinox.registry_at_start,
> ./plugins/org.eclipse.osgi.services_at_start
> osgi.bundles.defaultStartLevel=4
> eclipse.ignoreApp=true
> # End of file marker - must be here
> eof=eof
>
> Also i should mention this, the way i have created my osgi bundle is by
> including the grizzly-servlet-webserver-1.8.0.jar inside the bundle archive
> and using Bundle-Classpath attribute in the manifest.


OK I will try that. It's an holiday here so I will not be able to try it
until next Tuesday. But your information help...Grizzly classloader is
build using:

> ClassLoader urlClassloader = new URLClassLoader(urls,
> Thread.currentThread().getContextClassLoader());
> Thread.currentThread().setContextClassLoader(urlClassloader);

It looks like the ClassLoader starting the application doesn't have
javax.management.* in its list. I guess it needs to be explicitly
listed....that's really strange. If you add to the Bundle-Classpath the
location of the jdk rt.jar, does it make a difference (it doesn't make
any sense, but just to see...)


Thanks

-- Jeanfrancois





>
>