Although GlassFish v3 Preview comes with Felixpre-installed, it's pretty easy to make it run on Equinox and other platforms. Given below are the simple steps... 1. Download Equinox or if you have it, use that. 2. cp org.eclipse.osgi_3.3.2.R33x_v20080105.jar $GlassFish_HOME/osgi/equinox/ (replace 3.3.2.R33x_v20080105 by the actual version found in jar name in your equinox installation. It changes from version to version.) 3. Start GlassFish, but while starting let it know that you want to run on Equinox, else by default it uses Felix. To do this, you have couple of choices: a) You can set an environment variable calledGlassFish_Platform as Equinox. b) You can set a system property called GlassFish_Platform as Equinox. Why do we have these two options? The system property is handy when you are starting using "java -jar" command. The environment variable is useful when you are starting using the classic way, i.e., "asadmin start-domain." Putting them in practice: (I am using Bash shell in the following example) 1. In the following example, we set the option once in the environment and every subsequent use of "asadmin start-domain" starts GlassFish on Equinox.

   export GlassFish_Platform=Equinox
   asadmin start-domain

2. In the example below, asadmin start-domain is used to start GlassFish, but you are able to specify the enviornment variable on the same command.

GlassFish_Platform=Equinox asadmin start-domain

3. If you are used to "java -jar" style of starting GlassFish (a new thing in GlassFish v3), then do this:

java -DGlassFish_Platform=Equinox $GlassFish_HOME/modules/glassfish.jar

Frequently Asked Questions: 1. What is the order of precedence? In our bootstrap code that decides which platform to use, System property takes precedence over environment. So, if you set GlassFish_Platform in both system property and in environment, system property wins. 2. What are the allowable values for GlassFish_Platform? The set of acceptable values are statically defined in an Enum like this: public enum Platform {Felix, Knopflerfish, Equinox, Static} So, you can specify any one of them. The default value is Felix. 3. What platform does "Static" mean in the above Enum? Well, GlassFish can run without OSGi as well. Static refers to that mode. There appears to be some use case for this mode. 4. OK, I seeKnopflerfish being mentioned as one of the platforms. How can I run on that? When we started our OSGi effort, we were using only R4 APIs and hence we could run on all three popular, open source OSGi platforms. Later on, we had to rely on some R4 version 4.1 APIs - to be precise, on"transient" start/stop of bundles supported via new API called Bundle.start(int), Bundle.stop(int). Knopflerfish still does not implement them. Last time, when I checked with them, they told that they will switch from R4 to R4.2 directly. So, latest GlassFish v3 (something like GlassFish 3.0-Preview) does not currently run on Knopflerfish. Having said that, GlassFish 3.0-Prelude can run on Knopflerfish. 5. Where do I find configuration file for each platform? Here is where you can locate the configuration files: Felix -> glassfish/osgi/felix/conf/ Equinox -> glassfish/osgi/equinox/configuration/config.ini Knopflerfish -> Not available, as latest GlassFish does not run on it. 6. Must I have my OSGi framework jars copied to GlassFish installation directory? What if I am sharing an installation and don't have permission to change the installation? No, you don't have to copy the OSGi framework jars to glassfish/osgi directory. You can keep them on a separate location and refer to that using environment or system variables. e.g., you can do this: mkdir /usr/equinox cp org.eclipse.osgi_3.3.2.R33x_v20080105.jar /usr/equinox/ cp -r glassfish/osgi/equinox/configuration/ /usr/equinox/ java -DGlassFish_Platform=Equinox -DEQUINOX_HOME=/usr/equinox/ glassfish.jar Of course, you can set those properties using environment variables as well if you don't want to set them every time. 7. While running on Equinox, I get a WARNING like this: WARNING: Failed to install .../glassfish/modules/osgi-main.jar because of org.osgi.framework.BundleException: Bundle "com.sun.enterprise.osgi-main" version "0.3.64" has already been installed from: initial@reference:file:../../modules/osgi-main.jar/ It is coming because our management agent, which goes through modules dir to install all the modules, is trying to install a module called osgi-main.jar, but that module is already configured in config.ini to be autostarted. You can safely ignore the warning. 8. How do I add support for other OSGi platforms? Currently, you have to make some changes in our bootstrap code to achieve this. To be precise: in two files: and a new file that you need to supply. This is because of lack of standard way of starting OSGi frameworks. Work is in progress in OSGi Core Platform Expert Group under RFC #132 to have a uniform API to start a framework. Once it is available as part of OSGi R4.2 platform, we will switch to it and integration with other frameworks will be much smoother. Conclusion Happy GlassFish-ing. As usual, please refer to The Aquarium for more information about GlassFish suite of projects and products. Your feedback is always welcome.