Skip to main content

GlassFish v3 Prelude OSGi support: Is it really true?

Posted by ludo on November 6, 2008 at 11:55 AM PST

Bonjour, comment Java?

It has been said that GlassFish V3 Prelude could run with Eclipse Equinox OSGi implementation, but I could not find any real article on the web on how to setup this configuration. GlassFish V3 Prelude is bundled with Apache Felix OSGi implementation and this is the supported OSGi platform.The GlassFish community has also the honor and privilege of working directly with Richard Hall who recently joined Sun Microsystems.

But it does not mean we cannot try our runtime with other OSGi implementations to detect either bugs in our OSGi usage or bug in OSGi implementations:-).

Here are the steps to make the GlassFish v3 Prelude running on top of Equinox. There are still a few warnings in the log file that will be addressed soon I guess.

Download the fist Equinox zip file from http://download.eclipse.org/eclipse/equinox/
unzip this file under the GlassFish v3 Prelude directory. In my case this directory is C:/glassfishv3-prelude/glassfish
You should now see the following directory structure:

C:/glassfishv3-prelude/glassfish/eclipse/plugins/*.* jars
C:/glassfishv3-prelude/glassfish/eclipse/features/

create  a new C:/glassfishv3-prelude/glassfish/eclipse/configuration directory and create a config.ini file in this configuration directory:
First lines of this file  need to be adapted to your installation directory:

# GlassFish required properties

com.sun.aas.installRoot=C:/glassfish-v3-prelude/glassfish/

com.sun.aas.instanceRoot=C:/glassfish-v3-prelude/glassfish/domains/domain1/

# HK2 OSGi Adapter property

org.jvnet.hk2.osgiadapter.contextrootdir=C:/glassfish-v3-prelude/glassfish/modules
...
...

You are almost done. Now you need to configure the GlassFish v3 Prelude runtime to use Equinox instead of Felix. To do that, set the GlassFish_Platform environment variable:

On Windows, you can do  in a terminal:

set GlassFish_Platform=Equinox
On Mac OSx, you would do something like:
export GlassFish_Platform=Equinox

Now, from the  C:/glassfishv3-prelude/glassfish/bin directory, you can start the default domain:

.\asadmin start-domain --verbose

The server is starting...

ishot-79.png

And the welcome page can be seen:

ishot-80.png

There are still too many warnings in the console and I made Jerome aware of the issue. He told me that this will be fixed soon...

It would be nice to see how the other Application Servers based on OSGi framework handle OSGi implementation customization...Any links?

Thanks,
Ludo

Related Topics >>