Equinox/RAP WAR deployment: an end to the pain

Equinox/RAP WAR deployment: an end to the pain

Please note: This post is outdated. Please read this post and do not follow the install instructions in this one.

A few weeks ago I presented you my GSoC 2010 project. The idea was to make Equinox/RAP WAR deployment easier. And yes, it was a real pain to create .war files for an Equinox/RAP application. About 215 deployment related threads on the RAP newsgroup speak for themselves. But the pain is over now, and I think I can say,  “Mission accomplished”.

I want to introduce you to a new concept called WAR Products. They are similar to Eclipse Products but much more lightweight. All you have to do to export a RAP application is to create a .warproduct based on a working launch configuration and press ‘export’. The exported .war file is ready to deploy. There is a function included that validates your .war file content before you’ve exported it. If you don’t believe me,  watch the screencast below and see for yourself.

You can use the tooling right now, but please keep in mind that we are still polishing. The final goal is to contribute it back to PDE, but there are still a few things to do before we make the contribution.  One of those items is to get your initial feedback so when you use the WAR Products tooling, please be sure submit your feature requests or file bugs and help us to continue to improve the tooling.

Here is what you need to do to use the WAR Products tooling:

  1. Install the tooling from this repository into your IDE: https://download.eclipsesource.com/~hstaudacher/warproducts/3.7
  2. Set up your target. You need to add RAP 1.4 M5 or the Server-Side Equinox SDK.

Again, comments, bugs and feature requests are appreciated!

At this point I want to thank some people. First of all, Rüdiger Herrmann for great mentoring and the whole RAP team for all the nice evenings in the beer garden. Not to forget Simon Kaegi, Scott Lewis and Chris Aniszczyk and the rest of the Equinox and PDE teams for tuning up the Product concept. Your changes made things much easier.

And, I hope that you will find WAR deployment and creating WAR Products not just easier, but completely pain free!

  • Karsten Voigt
    Posted at 20:34, 2010-08-17


    cool and very useful thing. I tried to create my first warproduct, but I’m not able to export the war file. I use Windows (that might an issue 🙂 ), the WEB-INF folder was created and the file launch.ini is available.


    java.io.FileNotFoundException: D:projectprivtdworkspacetest.ui.rapWEB-INFlaunch.ini (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.(Unknown Source)
    at org.eclipse.rap.warproducts.core.WARProductExportOperation.createWarContent(WARProductExportOperation.java:282)
    at org.eclipse.rap.warproducts.core.WARProductExportOperation.prepareWARFile(WARProductExportOperation.java:237)
    at org.eclipse.rap.warproducts.core.WARProductExportOperation.handleRootFiles(WARProductExportOperation.java:226)
    at org.eclipse.rap.warproducts.core.WARProductExportOperation.createBuildPropertiesFile(WARProductExportOperation.java:208)
    at org.eclipse.rap.warproducts.core.WARProductExportOperation.run(WARProductExportOperation.java:125)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

  • Karsten Voigt
    Posted at 14:54, 2010-08-18

    You’re right. That was the issue. Using the latest version a war file is created. Thanks.

  • Myoungki
    Posted at 10:50, 2010-08-20

    Thanks a lot. It works well. I really appreciate your work!.

  • Patrick Godeau
    Posted at 15:03, 2010-08-24

    This seems very interesting.
    Does it work only in Eclipse 3.6?

  • Posted at 17:39, 2010-08-24

    Thank you for developing this utility with a good integration in the Eclipse-IDE.

    But I have a problem with the fragment “org.eclipse.equinox.servletbridge.extensionbundle” that is essential in the distribution.
    Without this plug-in the war-File the distribut is working … or not. I don’t know why but my file was working on Websphere until a new version of Websphere was installed on a new server and then suddendly the osgi platform

    couldn’t resolve the package “javax.servlet”
    (org.osgi.framework.BundleException: The bundle “xxx.yyy.zzz [22]” could not be resolved. Reason: Missing Constraint: Import-Package: javax.servlet; version=”2.5.0″).

    Since I add the above fragment it works well.

    BUT this fragment cannot be placed in my target platform as described because then all my plugins that are using the following class “javax.servlet.http.HttpServletResponse” for instance doen’t compile anymore. The reason is that the class comes in the IDE from the plugin javax.servlet and the fragment interfers now negatively.

    Conlusion :
    I’m probabily not the only one who use classes from “javax.servlet.http” so that the solution is probably to include the fragment “org.eclipse.equinox.servletbridge.extensionbundle” during the generation of the war-File and not in the target platform.

    Best regards, Serge Démoulin.

    • Posted at 18:22, 2010-08-24

      One of the problems that I saw from time to time on Websphere is the version of javax.servlet.

      If you are using a standard Eclipse it will use a very new version (2.5.0) of javax.servlet and PDE includes this as version into the dependencies. On your runtime environment (websphere) it is very likely that there is only a version <2.5.0 of the javax.servlet. Maybe this is the root cause for the problem that you described above.

  • Benjamin Muskalla
    Posted at 22:56, 2010-08-24

    Serge, that’s why you should use Import-Package for all javax.servlet packages instead of wiring yourself to a specific bundle (javax.servlet vs extensionbundle).

  • Posted at 21:47, 2010-08-25

    good good, thanks

  • Karias
    Posted at 04:32, 2010-09-02

    Hi, I’m also exploring on the new war deployment and found the same issue: Missing Constraint: Import-Package: javax.servlet; version=”2.5.0?

    Although I’ve already placed it in the Import-Package, I’m not sure where else it’s failing. Should it be added in the lib folder of the war file? Thanks so much in advance.

    org.osgi.framework.BundleException: The bundle “org.eclipse.equinox.http.jetty_2.0.0.v20100503 [15]” could not be resolved. Reason: Missing Constraint: Import-Package: javax.servlet; version=”[2.5.0,2.6.0)”

    org.osgi.framework.BundleException: The bundle “org.mortbay.jetty.server_6.1.23.v201004211559 [35]” could not be resolved. Reason: Missing Constraint: Import-Package: javax.servlet; version=”2.5.0″

  • Karias
    Posted at 12:08, 2010-09-02

    Hi Holger, thanks for the reply.

    I didn’t include the javax.servlet but I’m getting the missing constraint error. So I’m quite confused where else I need to have it included. I also made sure javax.servlet was in my project’s imported packages. Sorry I’m still new at this.

    I validated my WAR and the message was: No problems detected. I’ve also removed the jetty bundles. So now the only error message I’m getting is for my own bundle — still that missing constraint.

    Appreciate your help on this.

  • Karias
    Posted at 11:28, 2010-09-03

    Its now working! Thanks so much for this feature and for helping out!

  • Karias
    Posted at 11:29, 2010-09-03

    Its now working! Thanks so much for this feature and for pointing me to the right direction!

  • Posted at 12:54, 2010-09-06

    Sorry fo my barbarian English.
    Thanks for your tool, it very handy.
    Some remarks.
    I works under Windows ?P, Eclipse Helios and RAP 1.3
    When i try to use this tool i have some problem after “War Product Configuration” wizard complete :
    1. in my case, wizard generate instead name eclipse.equinox.servletbridge_1.2.0.v20091026.jar strange name: .jar
    2. conse respectively, when i try validate project i got messages:
    “Library doesn’t exist at location .jar
    Missing library org.eclipse.equinox.servletbridge.jar”
    I try my project and demo RAP mail template with the same result.
    Then i make some workarounds and got it works.
    1. on workspace create plugin from existing jar (org.eclipse.equinox.servletbridge.jar)
    2. delete .jar
    3. add org.eclipse.equinox.servletbridge.jar
    4. validate ok
    5. export war produkt (first time it complaints in old manner, but work) and deploy it
    It works!
    Another time thanks Holger, i hope you remove all these bug or say me where i mistaken.

  • Posted at 16:11, 2010-09-06

    Holger, thanks for your replay!
    I don’t sure this bug.
    Information (workspace.zip & target definition) sended to your mail: hstaudacher[at]eclipsesource.com

  • Christopher Kropp
    Posted at 12:37, 2010-09-10

    Hi Holger,
    thanks for your work!
    I followed the instructions and deployed the war file via Tomcat Web Application Manager. When i want to call the page I get a permission error. I tried it with the simple HelloWorld RAP example, too, without luck. The error message I get looks like that:
    Exception report
    description The server encountered an internal error () that prevented it from fulfilling this request.
    javax.servlet.ServletException: Servlet.init() for servlet equinoxbridgeservlet threw exception

    root cause

    java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    java.security.AccessController.doPrivileged(Native Method)

    Any idea?

  • Christopher Kropp
    Posted at 13:11, 2010-09-10

    on my local Tomcat Server it works fine. So I have to look whats wrong with the remote server.

  • David Ellis
    Posted at 15:42, 2010-09-20

    Hi Holger,

    This looks great, thanks so much. I spent a couple of days trying to produce a WAR using other methods documented in books or tutorials, and I either couldn’t understand them or couldn’t get them to work.

    I only had one issue with the WAR Product tooling. When I went to Validate Bundles it could not find the library org.eclipse.equinox.servletbridge_xx.jar in the expected location. I worked around this by taking a copy of this jar from the runtime bundles into my project’s “lib” folder, and then removing and re-adding this in the WAR Product Configuration, and this fixed the problem, but not sure why this was necessary. Maybe this is the same issue Dmitry had above? I have a screen shot I can send you if that helps.



  • Posted at 07:54, 2010-09-24

    Hi Holger,
    It seems like David had same problem.
    My ticket https://bugs.eclipse.org/bugs/show_bug.cgi?id=324641 still ignored?
    Regards Dmitry

  • Posted at 14:08, 2010-10-05

    Hi Holger,

    Thank a lot for your great work! I would like know if we can discuss together because I would like improve your work. Indead I have tried to improve Servletbridge in the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=323707 to support dev-mode with ServletBridge: I would like use bundles from the workspace directly to avoid creating a JAR and copy/paste in the WEB-INF/plugins folder of the WEB Application. My patch works, I have written several articles about that at https://angelozerr.wordpress.com/about/osgi-equinox-in-a-servlet-container/

    BUT if you read https://bugs.eclipse.org/bugs/show_bug.cgi?id=323707 you can see that Simon Kaegi will prefer having a tool which manage ServletBridge dev-mode, on other words using a product to manage dev-mode (and after distribution). Simon Kaegi suggest me to see your work and I’m not disappointed! I’m modifying your Plug-In to manage this feature : when you modify + save the product (ex : add new bundles) it generate you the well WEB-INFconfigurationconfig.ini with real path of bundles. After when you deploy your WEB Application only the config.ini (an dev.properties that I must manage) is used to use ServletBridge. Generate config.ini automaticly when product changes must be optionnal (I must manage that). I will be happy if we can discuss together with this feature. Hope you will agree to discuss with me.

    Thank a lot.

    Regards Angelo

  • Posted at 16:40, 2010-10-05

    Hi Holger,

    Thank a lot for your answer. I have created a bug at https://bugs.eclipse.org/bugs/show_bug.cgi?id=327015

    Regards Angelo

  • David Ellis
    Posted at 17:24, 2010-10-28

    Hi, just a long shot …

    We have created a test RAP application and deployed to WebSphere App Server (WAS) in this way and it works nicely.

    Except … we are unable to make JDBC connections from within the application, and we need to do database access. It is failing on the JNDI create Initial Context call. When I run the same code on the same server within a native WAR application, not produced from RAP, it works fine.

    The error we get is:

    javax.naming.NoInitialContextException: Failed to create InitialContext using factory specified in hashtable {java.naming.provider.url=corbaloc:rir:/NameServiceServerRoot, java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory, java.naming.factory.url.pkgs=com.ibm.ws.naming:com.ibm.ws.runtime:com.ibm.iscportal.jndi} [Root exception is java.lang.NullPointerException]

    So I guess this is something to do with the fact that it is running within the OSGI container, and not native within WAS, and I have web searched and tried a few obvious fixes on this issue, but have not so far been able to get it to work.

    Has anyone by any chance got a successful example of JNDI/JDBC calls working in this environment?

    Many thanks


  • David Ellis
    Posted at 15:00, 2010-11-04

    Well, just to let you know I resolved that by including “naming.jar” from the WebSphere 7.0 runtime in my RAP project before building and installing the WAR file. Not sure why this was necessary but it resolved it, so I assume it was some issue with the class path or class loader not finding the WsnInitialContextFactory class. I was able to make a successful JDBC connection after that.

  • Marc
    Posted at 16:48, 2010-12-22


    first thanks for your work.

    It’s so so so so so so frustrating to have RAP working like charm in the IDE but fail to get the WAR working, which you think should be the easiest part.

    I managed to migrate a complex RCP application to RAP within days. (Since this was my first work with RAP, I spend most time building some additional tools like Upload/Download widgets etc. With this tools I guess I could have done it within 1-2 days).

    BUT: RAP war deployment is not a pain, it’s hell. I just upgraded my 3.5 installation to 3.6. It took me 1 day to get my 3.5 setup to export a war file tomcat can understand. ( Using the approach from the demo app.)

    Now with 3.6 I hoped things had improved – ok, hope dies at last.

    Searching through the net, I found your tool.

    Sorry to say, it did not work somehow.

    I ran into the same problem like mentioned in the other posts: Starting the web-app in tomcat I got an error:

    can’ resolve bundle javax.servlet, version 2.5.0

    It took me about a whole day to figure out, what the problem was.

    First issue:

    Somehow using Eclipse 3.6 forces me to import ‘javax.servlet’ and ‘javax.servlet.http’ in version 2.5.0 (!), else my source will not compile. ( I’m using HTTPServletRequest class in my code)

    I figured, that would force me to use tomcat 6.0 instead of 5.5, since only 6.0 supports servlets in version 2.5.

    Second issue:

    After upgrading Tomcat, i still got the unresolved bundle error. javax.servlet version 2.5.0 not found.

    What could it be ?

    I found out, that the the supplied bundle:


    which seems to export the missing javax.servlet bundle within a web application just exports version 2.4:

    See manifest.mf:

    Manifest-Version: 1.0
    Export-Package: org.eclipse.equinox.servletbridge; version=1.1, javax.
    servlet; version=2.4, javax.servlet.http; version=2.4, javax.servlet.
    resources; version=2.4
    Fragment-Host: system.bundle; extension:=framework
    Bundle-Name: Servletbridge Extension Bundle
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: org.eclipse.equinox.servletbridge.extensionbundle

    I manually edited this and changed to version to 2.5.

    OK, that should have done it, if there would not be:

    Third issue:

    This f…ing TomCat! I nearly deployed / started / stopped / debugged / tried / a whole day, nothing worked or changed a lot. Guess what ?

    I just deleted the work – directory, things worked immediately.

    So this worked for me with a 3.6 Eclipse RCP/RAP setup:

    – install the war exporter as described above
    – set dependencies (Import) to javax.servlet / javax.servlet.http to version 2.5.0, if needed
    – manually edit the org.eclipse.equinox.servletbridge.extensionbundle and set entries to version 2.5
    – Use TomCat 6.0
    – Always clear the TomCat work directory before deploying

    If thinks still don’t work, active the OSGI console in the web.xml of your application:


    Equinox Bridge Servlet
    Equinox Bridge Servlet







    In the console type ‘ss’ to list all bundles. There should be no bundle with the status ‘Installed’. If there are such bundles, use ‘start ‘ to find the problems

    Hope this helps !

    So Holger, all of this is not the fault of your excellent tool, but it still costs my a whole day (at least) to get a working setup for WAR deployment.

    A failsafe WAR deployment must be Nr. 1 on the todo list of the RAP development team. What ever you plan to to with RAP, it will end in creating a WAR, which still is hell somehow.

    Best regards


  • Marc
    Posted at 16:52, 2010-12-22


    my copy of the web.xml did not come through in my post…

    just uncomment the ‘commandline/-console’ part to activate the osgi console.



  • Marc
    Posted at 13:02, 2010-12-23


    just an add to my former posts.

    After evaluating the problems and solutions, I started again with a clean setup.

    The problem seem to start, if any classes from the javax.servlet package are used somewhere. (like ‘RWT.getRequest()’ I’m using in my Upload Widget).

    If you have such a project, while installing the ‘warproducts’ extension like described above, you must NOT copy the bundle org.eclipse.equinox.servletbridge.extensionbundle to your Target Plattform. It exports ‘javax.servlet’ without providing the classes and interferes with the javax.servlet package in the Target Plattform. Your classes using classes from javax.servlet will not compile any longer.

    Except that, you can build your war file as described.

    After the WAR file is created:

    – unzip the file into a directory.
    – add the ‘org.eclipse.equinox.servletbridge.extensionbundle_1.2.0.20100513-1758.jar’ the the WAR directory ‘WEB-INF/plugins’
    – add entry ‘org.eclipse.equinox.servletbridge.extensionbundle@start’ at the end of the file ‘WEB-INF/configuration/config.ini’. Be careful to add it directly at the end ( separated by a ‘,’) without any CR. ( Avoid the Notepad/Editor, use WordPad )
    – rapack the directory to a WAR file again – done

    This worked finally on my Eclipse 3.6 installation.

    Hope this is useful for anyone using this great tool.

    Looking back, I’m wondering why it took me so long to figure out the solution.

    Thank you again Holger, for your great work !



  • Tom
    Posted at 14:23, 2011-01-17


    thank you for your great work but I have a small problem to include my images to the war-product.
    Here is a short description what I’ve done:

    RAP-Project in Eclipse 3.6:



    Style-Sheet Example:

    ToolBar {


    I create the WAR-product (“MY.war”) as shown in the video

    using tomcat 7.0.5 to start the war file

    apache-tomcat tree:

    start with mozilla -> https://localhost:1111/my/rap?startup=view

    I see my application in the Browser but the images from the style sheet are not loaded

    can somebody help me?


  • Tom
    Posted at 14:48, 2011-01-17

    yes i do.


    binary build
    images [x]

    source build
    images [x]

  • Farooq Kamal
    Posted at 09:47, 2011-02-28

    Hi, I am using the correct tooling repo but the War product tooling seems different than the one from your wiki entry. There is no features tab (has only 3 tabs). Other than this could you please include the “allow for binary cycles in target platform” option

  • Hussein Kobeisi
    Posted at 16:14, 2011-03-05

    Hi Holger,

    iam trying to Export a war file, but i get the exeption:
    A cycle was detected when generating the classpath EaseeCommon_4.4.0, org.slf4j.jcl_1.5.11.v20100419-1106, org.slf4j.api_1.5.11.v20100519-1910, ch.qos.logback.classic_0.9.19.v20100519-1505, ch.qos.logback.core_0.9.19.v20100419-1216, org.slf4j.api_1.5.11.v20100519-1910.

    although the Validate doent show any errors.

  • Flavio Donzé
    Posted at 10:30, 2011-04-14

    I reported a Bug describing the cycle problem mentioned above:

  • Flavio Donzé
    Posted at 15:56, 2011-04-15


    I noticed another strange behavior during the export. It seems that bundles which are required “optional” are also being included in the export process, even though they are not part of the products configuration.

    Should I report a bug as well?

    greets and BTW great tooling. hope this will find it’s way into the RAP Tooling soon.

  • Flavio Donzé
    Posted at 12:00, 2011-04-18
  • Guy Davenport
    Posted at 17:50, 2011-11-25

    Hi, I am using Spring DM in an RAP application. I need to set the start level for a bundle (e.g. org.springframework.osgi.extender@4:start) in the config.ini. Is this possible using the warproduct?