Search |
||
Running GlassFish on other OSGi platformsPosted by ss141213 on May 30, 2009 at 12:05 PM PDT
Although GlassFish v3 Preview comes with Felix pre-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/ 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 called GlassFish_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) 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: 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 see Knopflerfish 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: 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: 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: 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? Conclusion »
Comments
Comments are listed in date ascending order (oldest first)
No, GlassFish still does not
Submitted by ss141213 on Thu, 2010-01-21 08:33.
No, GlassFish still does not use the new launcher API. Can you file an enhancement request for the same in glassfish issue tracker? |
||
|
Launch other Platform - Apache Felix Karaf