Eclipse Yoxos Services Downloads Blogs About
Home > Blogs >

Posts Tagged ‘virgo’

on Aug 10th, 2011How to extend the Virgo Jetty Server to support the RAP Widget Toolkit

First, a bit of news for developers following the Virgo project:  The release day for Virgo Maya is getting closer[1] with the successful RC1 release a few weeks ago.

Meantime, in this blog post I’ll describe another way of running RWT (the RAP Widget Tookit) based applications on the Virgo Jetty Server. I want to use Virgo’s RFC66 support to deploy web applications in OSGi.
The RFC66 Web Container specification creates an open standard that enables developers to deploy WAR files on OSGi. With a few modifications (see below) it is possible to deploy an RWT standalone application into an RFC66 container like Virgo.

Note: In addition to using the HttpService described here[2] with RAP 1.5 you can register RWT directly with an OSGi HTTP service. We’ll describe this in a follow-up post.

To extend Virgo you need to:

  1. Get a Virgo Jetty Server Release Candidate[3].
  2. Install our extension of Virgo as suggested here[4] into /repository/ext.

Note: You can get a patched RWT bundle here that  supports RFC66 deployment of RWT applications and the plan here. The Virgo deployment plan describes all bundles needed to support RWT applications in Virgo.

Copy the two downloaded artifacts into repository/ext:

~virgo-jetty-server> ls -1 repository/ext/*rwt*
repository/ext/org.eclipse.rap.rwt-1.5.0.plan
repository/ext/org.eclipse.rap.rwt_1.5.0.201108081102.jar

Next I added our RWT extension to the initial Virgo artifacts. This is configured in
config/org.eclipse.virgo.kernel.userregion.properties. We simply add our plan:

initialArtifacts=repository:plan/org.eclipse.virgo.kernel.userregion.springdm,\
         repository:plan/org.eclipse.virgo.jetty.web,\
         repository:plan/org.eclipse.rap.rwt

That’s all that has to be done on the Virgo side. If you start Virgo Jetty Server you should
see the extension starting properly:

[2011-08-08 12:23:45.909] system-artifacts              Installing plan 'org.eclipse.rap.rwt' version '1.5.0'.
[2011-08-08 12:23:47.626] system-artifacts              Installing bundle 'org.eclipse.rap.rwt' version '1.5.0.201108081102'.
[2011-08-08 12:23:47.663] system-artifacts              Installed bundle 'org.eclipse.rap.rwt' version '1.5.0.201108081102'.
[2011-08-08 12:23:47.665] system-artifacts              Installed plan 'org.eclipse.rap.rwt' version '1.5.0'.
[2011-08-08 12:23:47.725] system-artifacts              Starting plan 'org.eclipse.rap.rwt' version '1.5.0'.
[2011-08-08 12:23:47.729] system-artifacts              Starting bundle 'org.eclipse.rap.rwt' version '1.5.0.201108081102'.
[2011-08-08 12:23:47.734] start-signalling-2            Started bundle 'org.eclipse.rap.rwt' version '1.5.0.201108081102'.
[2011-08-08 12:23:47.737] start-signalling-2            Started plan 'org.eclipse.rap.rwt' version '1.5.0'.

Because an RWT standalone application doesn’t know about OSGi classloading, I thought that one solution might be to use buddy classloading. First, I enabled buddy classloading in org.eclipse.rap.rwt.

Bundle-SymbolicName: org.eclipse.rap.rwt
Bundle-Version: 1.5.0.qualifier
...
Eclipse-BuddyPolicy: registered

Then I registered the RWT application com.eclipsesource.sovereign.swt.layout.web as a buddy:

Bundle-SymbolicName: com.eclipsesource.sovereign.swt.dialog
...
Require-Bundle:
 org.eclipse.rap.rwt
Export-Package: com.eclipsesource.sovereign.swt.dialog
Eclipse-RegisterBuddy: org.eclipse.rap.rwt
Web-ContextPath: /rap

Note: In the MANIFEST.MF of the web bundle we specified the context path to “/rap”.

Next I setup the RAP web application. The web.xml almost looks like that of a standard RWT standalone application. For more details please go to the RAP Wiki [5]:

<context-param>
  <param-name>org.eclipse.rwt.entryPoints</param-name>
  <param-value>com.eclipsesource.sovereign.swt.dialog.SwtDialogEntryPoint</param-value>
</context-param>
<listener>
  <listener-class>org.eclipse.rwt.internal.engine.RWTServletContextListener</listener-class>
</listener>
 
<servlet>
  <servlet-name>rwtDelegate</servlet-name>
  <servlet-class>org.eclipse.rwt.internal.engine.RWTDelegate</servlet-class>
</servlet>
<servlet-mapping>
  <servlet-name>rwtDelegate</servlet-name>
  <url-pattern>/</url-pattern>
</servlet-mapping>

You’ll see an additional section for the RWT resources:

<servlet>
  <servlet-name>rwtResources</servlet-name>
  <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
</servlet>
<servlet-mapping>
  <servlet-name>rwtResources</servlet-name>
  <url-pattern>/rwt-resources/*</url-pattern>
</servlet-mapping>

Now I was ready to deploy my RAP application. I simply copied the webbundle into Virgo’s pickup folder.

Note: You can get the sample RAP webbundle here.

[2011-08-08 12:25:34.421] fs-watcher                    Hot deployer processing 'CREATED' event for file 'com.eclipsesource.sovereign.swt.dialog_0.1.0.201108081127.jar'.
[2011-08-08 12:25:34.476] fs-watcher                    Installing bundle 'com.eclipsesource.sovereign.swt.dialog' version '0.1.0.201108081127'.
[2011-08-08 12:25:34.486] fs-watcher                    Installed bundle 'com.eclipsesource.sovereign.swt.dialog' version '0.1.0.201108081127'.
[2011-08-08 12:25:34.492] fs-watcher                    Starting bundle 'com.eclipsesource.sovereign.swt.dialog' version '0.1.0.201108081127'.
[2011-08-08 12:25:34.494] start-signalling-3            Started bundle 'com.eclipsesource.sovereign.swt.dialog' version '0.1.0.201108081127'.

And the application is available at localhost:8080/rap

[1] Virgo 3.0 (Maya) Release Candidate 1
[2] Running RAP on Virgo
[3] Milestone Downloads
[4] Extending Virgo with a HttpService
[5] How do I use an RWT standalone application in Tomcat

on Oct 28th, 2010Running RAP on Virgo

You used to have just two options for deploying a RAP application:

  1. Packing your application into a WAR archive and deploying it on a standard servlet container such as Tomcat, or
  2. Embedding the Application and a servlet container in a standalone Equinox instance.

Now you have a third option because RAP runs on Virgo! Virgo is a full-featured OSGi based application server and is one of the shining new stars of the Eclipse ecosystem. Previously, we weren’t able to deploy RAP applications on this server because we were blocked by bugs relating to split packages. However, over the last few weeks we worked together with the Virgo team to fix these issues and we are happy to report success.

Here are the steps we used to deploy RAP on Virgo. We know the process can be improved, but just to give you an idea of how it works, try the following:

  1. Download Virgo Kernel[1] (2.1.0.RELEASE) and unpack the downloaded archive to a directory (We’ll use ${KERNEL_HOME} in this post).
  2. Download the RAP Runtime[2] (1.3.x) and extract the contents of the plugin folder into the Virgo repository:
    unzip rap-runtime-1.3.1-R-20100915-2301.zip "eclipse/plugins/*.jar" -x "eclipse/plugins/*.source_*" -d /tmp
    cp /tmp/eclipse/plugins/*.jar ${KERNEL_HOME}/repository/usr
  3. (via OSGi console) Enable the OSGi console by configuring the User Region, Virgo’s subsystem for managing user applications.
    Open $SERVER_HOME/config/org.eclipse.virgo.kernel.userregion.properties and uncomment the osgi.console property: 

    ...
    # osgi console support
    osgi.console=2401

  4. (optional) Change the default port of the OSGi HttpServiceexport JAVA_OPTS=-Dorg.osgi.service.http.port=10081
  5. Start the Virgo Kernel
    ./startup.sh
     

    ...
    [2010-10-28 11:43:23.767] Thread-2 User region ready.

  6. Virgo Plans[3] encapsulate the artifacts of an application as a single unit. We’ve created a rap-demo.plan for you. You can inspect and download from here:
    rap-demo.plan
  7. Now add the downloaded rap-demo.plan to the pickup folder ${KERNEL_HOME}/pickup. You will see the following deployment:
    [2010-10-28 11:04:02.113] fs-watcher <HD0001I> Hot deployer processing 'MODIFIED' event for file 'virgo-rap-demo.plan'.
    [2010-10-28 11:04:02.161] fs-watcher <DE0000I> Installing plan 'virgo-rap-demo' version '1.3.1'.
    [2010-10-28 11:04:02.187] fs-watcher <DE0000I> Installing plan 'vigo-equinox-extensions' version '3.6.1'.
    [2010-10-28 11:04:02.209] fs-watcher <DE0000I> Installing plan 'virgo-rap-extensions' version '1.3.1'.
    [2010-10-28 11:04:06.397] fs-watcher <DE0000I> Installing bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
    [2010-10-28 11:04:06.966] fs-watcher <DE0000I> Installing bundle 'org.eclipse.osgi.services' version '3.2.100.v20100503'.
    [2010-10-28 11:04:07.473] fs-watcher <DE0000I> Installing bundle 'org.eclipse.equinox.preferences' version '3.3.0.v20100503'.
    [2010-10-28 11:04:07.775] fs-watcher <DE0000I> Installing bundle 'org.eclipse.equinox.app' version '1.3.1.R36x_v20100803'.
    [2010-10-28 11:04:08.440] fs-watcher <DE0000I> Installing bundle 'org.eclipse.core.commands' version '3.6.0.I20100512-1500'.
    ...
    [2010-10-28 11:05:45.458] fs-watcher <DE0004I> Starting bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
    [2010-10-28 11:05:45.464] start-signalling-1 <DE0005I> Started bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
  8. (via OSGi console) You can now start the OSGi HttpService using the Equinox Console and start the HttpService manually user@hostname:~/> telnet localhost 2401
    Trying ::1…
    Connected to localhost.
    Escape character is ‘^]’. 

    osgi> ss

    33 <<LAZY>> org.eclipse.equinox.http.jetty_2.0.0.v20100503

    osgi> start 33

  9. And, finally point your browser to http://localhost:10081/rap?startup=controls

That’s it – RAP is now running on Virgo. We want to improve this process over time and, hope that you will share some ideas with us on how to do this. You can respond to this blog or ping us on the RAP newsgroup.

PS -One alternative solution to starting the HttpService via the OSGi console is adding an autostart bundle to the plan:

  1. (via autostart) Download the org.equinoxosgi.core.autostart bundle as used at equinoxosgi.org – starts all lazy bundles in the OSGi container.
  2. (via autostart) Add the autostart bundle to the downloaded plan before dropping into the pickup folder. <artifact type="bundle" name="org.equinoxosgi.core.autostart" version="[1.0.0, 2.0.0)" />

[1] Virgo Downloads - http://www.eclipse.org/virgo/download/

[2] RAP Runtime - http://eclipse.org/rap/downloads/1.3/

[3] Virgo Documentation - Programmer Guide 4.3 Creating Plans - http://www.eclipse.org/virgo/documentation/

[4] Virgo Documentation - User Guide 11.1. Configuring the Virgo Kernel and User Region - http://www.eclipse.org/virgo/documentation/

on Jan 12th, 2010Two New Projects at Eclipse: Virgo and Graphiti

Today, the Eclipse Foundation announced two new projects at Eclipse.org, Graphiti and Virgo.

The Graphiti project aims to offer an Eclipse-based graphics framework to enable easy development of state-of-the-art diagram editors for domain models. SAP plans to contribute the developed framework. This could have a large impact in the Eclipse Modeling space where graphic modeling is only getting better and better. The contribution is also important because SAP is showing that it’s strongly committed to the Eclipse ecosystem.

The Virgo project will provide a runtime platform for the development of server-side enterprise applications built on top of Equinox, and optionally using modules from the Gemini project. On top of that, the Virgo project solidifies the EclipseRT vision that a lot of us have been preaching for awhile.

Want to learn more about EclipseRT? Check out the whitepaper.

Another thing to note about the Virgo project is that tooling will be coming along but contributed to specific projects at Eclipse.

Developer tools that provide support for Virgo are out of scope for the Virgo project as part of EclipseRT. However, the Virgo team also propose to work with the existing WTP and PDE projects to contribute relevant developer tools for Virgo to those projects. These contributions will be based upon the existing Bundlor and dm Server development tools projects detailed below.

So far, it looks like three out of twelve zodiac signs are taken for OSGi related projects.

zodiac1 Two New Projects at Eclipse: Virgo and Graphiti

Which one will be next icon smile Two New Projects at Eclipse: Virgo and Graphiti ?

© EclipseSource 2008 - 2011