Deploying RAP Applications Made Simple – Introducing the Virgo RAP Server

virgo rap eclipse Deploying RAP Applications Made Simple – Introducing the Virgo RAP ServerYes, we love building modular web applications, if they just were easier to deploy on a server! Wrapping OSGi applications in WAR files, apparently still the most popular deployment option for RAP, results in a complicated setup: a web app containing an OSGi runtime together with all bundles, configuration, and a bridge servlet that delegates requests to the embedded OSGi – that’s hard to build, hard to change, and hard to debug. Why can’t we just throw our application bundles into a webserver and simply turn it on?

Actually, we already have this technology in Eclipse, we just need to make it easier to use. To do so, the Eclipse RAP project and the Virgo project recently worked together to create a lightweight server for RAP applications that supports those out-of-the-box deployments. This package, we call it the “Virgo RAP Server”, is an OSGi container based on Equinox, running the Jetty web server, and it’s pre-equipped with all bundles required to run a RAP application – with one exception: workbench applications are not (yet) supported.

A first version is now available on the Virgo build server. This download always contains the latest RAP bundles (RAP 2.3 M1 at the time of writing).

[ More on RAP from our blog: RAP technology overview | Using RAP or Virgo in an industrial setting? Our technology subscriptions secure your investment for years to come. ]

Getting started

Running your application on this server requires only these three steps:

1. Extract the zip file to a folder of your choice

$ unzip virgo-nano-rap-3.7.0.CI-2014-02-21_02-04-03.zip
$ cd virgo-nano-rap-3.7.0.CI-2014-02-21_02-04-03

2. Copy your application bundles into the pickup/ directory

$ cp ~/org.example.rap-1.0.0.jar pickup/

3. Start the server using the startup script in bin/

$ bin/startup.sh

That’s it! Now you can access your application at http://localhost:8080/example (replace “/example” with the servlet path of your entrypoint).

Admin console

The Virgo RAP server comes with a nice admin console that can also display package and service wirings between bundles. You can access it at http://localhost:8080/admin. The default credentials are admin:admin.

virgo admin console Deploying RAP Applications Made Simple – Introducing the Virgo RAP Server

If you want to get rid of the console for production, simply remove the bundle org.eclipse.virgo.management.console from the pickup/ directory.

Settings

Here’s are short list of things you may like to configure:

Change HTTP port

Per default the embedded Jetty is running on port 8080. The port can be configured in configuration/config.ini.

org.osgi.service.http.port=8080

Enable Equinox OSGi console

The OSGi console is deactivated by default. It can be enabled for access via SSH and/or telnet in configuration/osgi.console.properties:

telnet.enabled=true
telnet.port=2401
telnet.host=localhost
ssh.enabled=true
ssh.port=2402
ssh.host=localhost

Logging

The log files can be found in serviceability/logs. Logging is configured in configuration/serviceability.xml, for a description of the syntax and facilities provided by this file, please consult the LOGBack Manual.

Debugging

To enable remote debugging, start the server in debug mode by adding the parameter -debug to the startup script. Optionally you can also add the -suspend flag to suspend the VM on startup until your IDE connects. For example, you can use this method to observe the startup of your already deployed bundles.

Future

If there’s interest in this deployment option, we plan to provide a stable version of the Virgo RAP server together with this year’s Eclipse release “Luna”, in June 2014.

Let us know what you think! Could this be an interesting option for your project?

11 Responses to “Deploying RAP Applications Made Simple – Introducing the Virgo RAP Server”

  1. Neil Mackenzie says:

    That looks great. I spent my whole day yesterday trying to deploy an RAP/OSGI app using WAR Products! it turned out my problem was because I was using tomcat 8, but it took me a long time to find that out as the documentation and and ability to troubleshoot is not so clear using WAR Product. RAP is great technology, so tooling that makes it easier to run and test is very welcome!

  2. Cole Markham says:

    That’s awesome, I’ve been wanting this for quite some time. What’s required to support workbench apps? Sounds like a good challenge to add that support at the EclipseCon hackathon.

  3. Dave Joyce says:

    We are embarking on a major initiative to migrate from an old Eclipse 3.x RCP app into a new Eclipse 4 platform app using RCP or RAP. The availability of Virgo RAP Server for simplified deployment could be a game changer!

  4. Timo Rohrberg says:

    This sound absolutely fantastic! Deployment of RAP application was always a bit of a hassle. With this Virgo RAP server, it becomes as easy as a charm! To futher push that approach is definitely worth it!

    What I don’t understand yet is, why are workbench applications not (yet) supported? What exactly is the problem? And are there any plans to fix that in near future?

  5. Ralf Sternberg says:

    Thanks for the encouraging feedback everyone!

    As for the workbench, it should actually be possible to run workbench applications on this server if you add all the missing bundles. The 3.x workbench just does not match our idea of a modern and “lightweight” platform anymore, therefore we didn’t want to include these bundles in the Virgo RAP server in the first place. However, we’ll look into it and publish at least some kind of tutorial how to run workbench applications on this server.

  6. Florian Waibel says:

    @Cole: That’s a good idea. I will definitely drop by at the EclipseCon hackathon.

  7. Arun Kumar says:

    This is AWESOME!!! Just came to know about this server from the “EclipseSource Developer News” email. Deploying RAP apps on non-OSGI server is certainly a headache. Warproducts functionality is certainly a boon towards solving this problem but I would still prefer to use an open-source OSGI-based server to deploy my apps on.

    I “one-up” this initiative!!

    If the tutorial for running workbench applications on this server has been published, can someone point me towards it please. Thanks in advance.

  8. Philippe says:

    Oh, thats so cool. I am currently frustrated in deploying by warproducs (cycle pain). Spend almost a day without any positive result. So I decided to go with your, the more forward way of an osgi jetty server.

    Since I need the workbench, I’m curious on any news. Did you keep up working on the workbench part?
    Unfortunately, the provided link to a virgo server (no workbench) is not working anymore.

  9. Hesham Saleh says:

    Great news, RAP was always an interesting project, putting extra effort in tooling to create a simpler bundle is always a step in the right direction when it comes to OSGi-related technologies, I hope it gathers more interest from the community to keep the integration project alive and making it easier for simple out-of-the-box deployments, which definitely would attract more to the RAP area.

  10. Florian Waibel says:

    @Philippe: Sorry for the late response. I overlooked your comment somehow. The anonymous permission was missing in the Virgo Hudson instance after an update to 3.1.2. The link is working again.

  11. John Zhang says:

    Would be nice if have a built-in RAP example.

11 responses so far

Written by . Published in Categories: EclipseSource News, Editors choice, Planet Eclipse, Planet OSGi