The following tutorial shows how to create a
WAR file that contains the
org.eclipse.rap.demo project as RAP application.
Note: As with RCP applications there are a wide variety of possible configurations. What's given in this tutorial is just one possibility.
As prerequisites we assume that you:
org.eclipse.rap.demointo your workspace
org.eclipse.rap.demoplug-in and use the command Import As > Source Project from the context menu to import
org.eclipse.rap.demoas project in your workspace.
WAR file using the WAR Products tooling is centered around
.warproduct configuration. The
.warproduct configuration is
entirely managed by the WAR Products tooling to simplify war deployment. It's format
is internal and is not intended to be read by tools other than the WAR Products tooling.
To create a
.warproduct configuration you can use a working launch
configuration. Follow these steps to create a
configuration for the RAP demo application:
New WAR Product Configurationwizard.
RAP Workbench Demofrom the available launch configurations.
WAR Products tooling provides a form-based multi-page editor to manage a
.warproduct configuration. The editor has the following pages:
Overview: on this page you can enter additional information like
Versionbut they are not needed to export a war archive. Also the
WAR Product exportwizard can be started from the
Configuration: Here you can manage which plug-ins and libraries to be included into the war archive.
Web.xml: On this page the web.xml of the war archive can be edited.
Overview page of the
editor start the
WAR Product export wizard (this can also be reached by launching
the general Export Wizard), enter the location for the war
archive and press Finish if no validation errors exist. After that you can deploy
WAR file to a servlet container. See the uncommented sections in the web.xml
for more information on how to activate the OSGi-console. This is useful if you run into troubles
while deploying the generated WAR file.
To deploy your own application like described above you will have
to create your own
.warproduct configuration. The configuration
should contain the same plug-in references as the
(except the demo-plug-in of course!) plus the plug-ins that make up your application.
It is important that your plug-ins reference the Servlet API by using the
Import-Package directive instead of the
directive. See the
MANIFEST.MF of the demo project for an example.
Note: Besides the application server log files there also exists an Equinox framework log that can be found under the webapp's work directory, e.g. on Tomcat:
In case Equinox isn't able to start at all, you may also look for log files at:
You can use the following checklist to find errors when your exported application does not work:
plugin.propertiesfiles, make sure they are exported.
<init-param> <param-name>commandline</param-name> <param-value>-console</param-value> </init-param>
-consoleand then telnet to the OSGi console:
telnet localhost <port>.
ssin the console and see if all bundles are started. If not try starting them with
start <bundle-id>. The stack traces may hint to what is missing.
ss-listing who's state is
javax.servletbundle. In the plug-in manifest the
javax.servletmust be listed in the
Import-Packagesection, not in
The product configuration is based on featureson the Overview page.
javax.servletpackages. Be aware that unresolved optional dependencies aren't reported as errors.
Further hints can be found in the RAP FAQ