Contents

Trying out Gemini Web

1. Download the Equinox JAR, and move it to a suitable directory (e.g. ~/gemini-web-test). On the Download page first choose the Release for the appropriate Gemini Web version, then download the JAR from the Framework section.

a. Gemini Web 1.1.x - Create files config.ini and Java6-server.profile in the configuration directory. Example files which works with 1.1.0.RELEASE
are available in config.ini.zip and Java6-server.profile.zip.
b. Gemini Web 2.0.x - Create file config.ini in the configuration directory. Example file which works with 2.0.1.RELEASE is available in config.ini.zip.
c. Gemini Web 2.1.x - Create file config.ini in the configuration directory. Example file which works with 2.1.0.RELEASE is available in config.ini.zip.

Essentially config.ini ensures that Java6-server.profile is used and that the dependencies of Gemini Web, which come in the dep directory, are installed and then the Gemini Web bundles are installed and started. Java6-server.profile ensures that javax.xml.ws is exported at version 2.1.1 from the system bundle as the Tomcat bundles in Gemini Web depend on that version.

5. You can then deploy WAR files (a trivial example is available in Osgi.web.app.zip) and web bundles using the install and start commands from the console. Refer to the documentation for more information.

Set as a Target Platform in PDE

The following steps enable you to develop Web Application Bundles that compile against the libraries of the Gemini Web container by using the existing Plug-in Development Environment (PDE) tooling in Eclipse.

From the list with available items, choose Eclipse Gemini Web. Click the Finish button.

Make sure that all 42 bundles from that update site are selected.

Click the Finish button to close the New Target Definition wizard.

Select the newly created target definition and click the OK button to activate it for you PDE environment.

Run as OSGi Framework from the Eclipse IDE

The following steps enable you to deploy and run the Web Application Bundles in your Eclipse workspace on the Gemini Web container.

OSGi Framework run configuration, Bundles tab

OSGi Framework run configuration, Arguments tab

OSGi Framework run configuration, Settings tab

Make sure you have set the Gemini Web container as a target platform as described in the previous section.

Open Run > Run Configurations... from the main menu of the Eclipse IDE.

Navigate to the OSGi Framework category.

Right-click > New.

Give a Name for you run configuration (like "Gemini Web").

Open the Bundles tab.

Make sure all of the bundles under the Target Platform node are selected.

Select the bundles from the Workspace you want to deploy in the Gemini Web container.

Gemini Web 1.1.x

Switch to the Arguments tab.

Add the following system property to the VM arguments: -Dosgi.java.profile=file:configuration/java6-server.profile

Select the Other radio button in the Working directory group and specify the path to the ~/gemini-web-test folder.

Switch to the Settings tab.

Deselect the Use default location check box in the Configuration Area group.

Specify the path to the ~/gemini-web-test/configuration folder in the Location text field.

Gemini Web 2.0.x - no additional changes needed.

Click the Run button.

You will see some logs dumped in the Console view. After a second the Gemini Web container is started and the Web Application Bundles from the workspace are deployed. You can now call you application from the browser using URLs like:

http://localhost:8080/<context-root>/...

The above steps are needed only for the first run of Gemini Web. Any subsequent runs can be executed much simpler:

How to stop Gemini Web?

The safest way to stop Gemini Web is to type close in the Console view and hit Enter.

You need to stop any old instance of Gemini Web before starting it again. Otherwise, the new instance won't start correctly, because the old one still occupies the http port (and, perhaps, other system resources).

How to run in debug mode?

You will get all debug features (including hot code replace) from JDT and PDE for free.

Limitations

Gemini Web is a designed to be an application server component rather than a fully-functional application server. As such it has some limitations:

Some resources are not available by URL (see bug 325578). Virgo, for example, works around this by installing an Equinox hook to ensure that all resource URLs returned have a "file:" protocol and not a "bundleresource:" protocol which is the default returned by Equinox.