Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "RAP/Running RAP on virgo"

< RAP
Line 3: Line 3:
 
@see Blog post [http://eclipsesource.com/blogs/2010/10/28/running-rap-on-virgo/ Running RAP on Virgo]
 
@see Blog post [http://eclipsesource.com/blogs/2010/10/28/running-rap-on-virgo/ Running RAP on Virgo]
  
You used to have just two options for deploying a <a href="http://eclipse.org/rap/">RAP</a> application:
+
You used to have just two options for deploying a [http://eclipse.org/rap/ RAP] application:
  
 
* Packing your application into a WAR archive and deploying it on a standard servlet container such as Tomcat, or
 
* Packing your application into a WAR archive and deploying it on a standard servlet container such as Tomcat, or
 
* Embedding the Application and a servlet container in a standalone Equinox instance.
 
* Embedding the Application and a servlet container in a standalone Equinox instance.
  
Now you have a third option because RAP runs on <a href="http://eclipse.org/virgo/">Virgo</a>!   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.
+
Now you have a third option because RAP runs on [http://eclipse.org/virgo/ 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:
 
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:
  
# [http://www.eclipse.org/virgo/download Download the latest Virgo Kernel (RC1)][1] and unpack the downloaded archive to a directory (We'll use ${KERNEL_HOME} in this post).
+
1. [http://www.eclipse.org/virgo/download Download the latest Virgo Kernel (2.1.0.RELEASE)][1] and unpack the downloaded archive to a directory (We'll use ${KERNEL_HOME} in this post).
# [http://eclipse.org/rap/downloads/ Download the latest RAP Runtime][2] and extract the contents of the plugin folder into the Virgo repository:
+
 
 +
2. [http://eclipse.org/rap/downloads/ Download the latest RAP Runtime][2] and extract the contents of the plugin folder into the Virgo repository:
 
<pre>unzip rap-runtime-1.3.1-R-20100915-2301.zip "eclipse/plugins/*.jar" -x "eclipse/plugins/*.source_*" -d /tmp
 
<pre>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</pre>
 
cp /tmp/eclipse/plugins/*.jar ${KERNEL_HOME}/repository/usr</pre>
 
+
3. '''(via OSGi console)''' Enable the OSGi console by configuring the User Region, Virgo's subsystem for managing user applications.
# '''(via OSGi console)''' Enable the OSGi console by configuring the User Region, Virgo's subsystem for managing user applications.
+
 
Open $KERNEL_HOME/config/org.eclipse.virgo.kernel.userregion.properties and uncomment the osgi.console property:
 
Open $KERNEL_HOME/config/org.eclipse.virgo.kernel.userregion.properties and uncomment the osgi.console property:
  
Line 24: Line 24:
 
osgi.console=2401
 
osgi.console=2401
 
</pre>
 
</pre>
# '''(optional)''' Change the default port of the OSGi HttpService
+
4. '''(optional)''' Change the default port of the OSGi HttpService
<pre>export JAVA_OPTS=-Dorg.osgi.service.http.port=10081
+
<pre>export JAVA_OPTS=-Dorg.osgi.service.http.port=10081</pre>
</pre></li>
+
5. Start the Virgo Kernel
<li> Start the Virgo Kernel
+
<pre>./startup.sh
<code>./startup.sh
+
</pre>
</code>
+
  
<code>...
+
<pre>...
 
[2010-10-28 11:43:23.767] Thread-2                      User region ready.
 
[2010-10-28 11:43:23.767] Thread-2                      User region ready.
</code></li>
+
</pre>
  
# 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:
+
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:
<a href="http://download.eclipsesource.com/~fwaibel/virgo/rap-demo.plan">rap-demo.plan</a></li>
+
[http://download.eclipsesource.com/~fwaibel/virgo/rap-demo.plan rap-demo.plan]
<li>Now add the downloaded rap-demo.plan to the pickup folder ${KERNEL_HOME}/pickup. You will see the following deployment:
+
 
<code>[2010-10-28 11:04:02.113] fs-watcher                  &lt;HD0001I&gt; Hot deployer processing 'MODIFIED' event for file 'virgo-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.161] fs-watcher                  &lt;DE0000I&gt; Installing plan 'virgo-rap-demo' version '1.3.1'.
+
<pre>&lt;HD0001I&gt; Hot deployer processing 'MODIFIED' event for file 'virgo-rap-demo.plan'.
[2010-10-28 11:04:02.187] fs-watcher                  &lt;DE0000I&gt; Installing plan 'vigo-equinox-extensions' version '3.6.1'.
+
&lt;DE0000I&gt; Installing plan 'virgo-rap-demo' version '1.3.1'.
[2010-10-28 11:04:02.209] fs-watcher                  &lt;DE0000I&gt; Installing plan 'virgo-rap-extensions' version '1.3.1'.
+
&lt;DE0000I&gt; Installing plan 'vigo-equinox-extensions' version '3.6.1'.
[2010-10-28 11:04:06.397] fs-watcher                  &lt;DE0000I&gt; Installing bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
+
&lt;DE0000I&gt; Installing plan 'virgo-rap-extensions' version '1.3.1'.
[2010-10-28 11:04:06.966] fs-watcher                  &lt;DE0000I&gt; Installing bundle 'org.eclipse.osgi.services' version '3.2.100.v20100503'.
+
&lt;DE0000I&gt; Installing bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
[2010-10-28 11:04:07.473] fs-watcher                  &lt;DE0000I&gt; Installing bundle 'org.eclipse.equinox.preferences' version '3.3.0.v20100503'.
+
&lt;DE0000I&gt; Installing bundle 'org.eclipse.osgi.services' version '3.2.100.v20100503'.
[2010-10-28 11:04:07.775] fs-watcher                  &lt;DE0000I&gt; Installing bundle 'org.eclipse.equinox.app' version '1.3.1.R36x_v20100803'.
+
&lt;DE0000I&gt; Installing bundle 'org.eclipse.equinox.preferences' version '3.3.0.v20100503'.
[2010-10-28 11:04:08.440] fs-watcher                  &lt;DE0000I&gt; Installing bundle 'org.eclipse.core.commands' version '3.6.0.I20100512-1500'.
+
&lt;DE0000I&gt; Installing bundle 'org.eclipse.equinox.app' version '1.3.1.R36x_v20100803'.
 +
&lt;DE0000I&gt; Installing bundle 'org.eclipse.core.commands' version '3.6.0.I20100512-1500'.
 
...
 
...
[2010-10-28 11:05:45.458] fs-watcher                  &lt;DE0004I&gt; Starting bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
+
&lt;DE0004I&gt; Starting bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
[2010-10-28 11:05:45.464] start-signalling-1          &lt;DE0005I&gt; Started bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
+
&lt;DE0005I&gt; Started bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
</code></li>
+
</pre>
<li><strong>(via OSGi console)</strong> You can now start the OSGi HttpService using the Equinox Console and start the HttpService manually<code> </code>user@hostname:~/&gt; telnet localhost 2401
+
 
 +
8. '''(via OSGi console)''' You can now start the OSGi HttpService using the Equinox Console and start the HttpService manually
 +
<pre>user@hostname:~> telnet localhost 2401
 
Trying ::1...
 
Trying ::1...
 
Connected to localhost.
 
Connected to localhost.
 
Escape character is '^]'.
 
Escape character is '^]'.
  
osgi&gt; ss
+
osgi> ss
 
...
 
...
 
33 &lt;&lt;LAZY&gt;&gt;    org.eclipse.equinox.http.jetty_2.0.0.v20100503
 
33 &lt;&lt;LAZY&gt;&gt;    org.eclipse.equinox.http.jetty_2.0.0.v20100503
 
...
 
...
  
osgi&gt; start 33</li>
+
osgi> start 33
<li>And, finally point your browser to <a href="http://localhost:10081/rap?startup=controls">http://localhost:10081/rap?startup=controls</a> ...
+
</pre>
 +
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.
+
10. 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 <em>autostart</em> bundle to the plan:
 
PS -One alternative solution to starting the HttpService via the OSGi console is adding an <em>autostart</em> bundle to the plan:
# <strong>(via autostart)</strong> Download the <a href="http://download.eclipsesource.com/~fwaibel/virgo/org.equinoxosgi.core.autostart_1.0.0.jar">org.equinoxosgi.core.autostart</a> bundle as used at <a href="http://equinoxosgi.org/">equinoxosgi.org</a> - starts all lazy bundles in the OSGi container.</li>
+
 
<li><strong>(via autostart)</strong> Add the autostart bundle to the downloaded plan before dropping into the pickup folder.<code> &lt;artifact type="bundle" name="org.equinoxosgi.core.autostart" version="[1.0.0, 2.0.0)" /&gt;
+
1. '''(via autostart)''' Download the [http://download.eclipsesource.com/~fwaibel/virgo/org.equinoxosgi.core.autostart_1.0.0.jar org.equinoxosgi.core.autostart] bundle as used at http://equinoxosgi.org/ - starts all lazy bundles in the OSGi container.
</code>
+
 
 +
2. '''(via autostart)''' Add the autostart bundle to the downloaded plan before dropping into the pickup folder.
 +
<pre> &lt;artifact type="bundle" name="org.equinoxosgi.core.autostart" version="[1.0.0, 2.0.0)" /&gt;
 +
</pre>
  
  
[1] Virgo Downloads - <a href="http://www.eclipse.org/virgo/download/">http://www.eclipse.org/virgo/download/</a>
+
[1] Virgo Downloads - http://www.eclipse.org/virgo/download/
  
[2] RAP Runtime - <a href="http://eclipse.org/rap/downloads/">http://eclipse.org/rap/downloads/</a>
+
[2] RAP Runtime - http://eclipse.org/rap/downloads/
  
[3] Virgo Documentation - Programmer Guide 4.3 Creating Plans - <a href="http://www.eclipse.org/virgo/documentation/">http://www.eclipse.org/virgo/documentation/</a>
+
[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 - <a href="http://www.eclipse.org/virgo/documentation/">http://www.eclipse.org/virgo/documentation/</a>
+
[4] Virgo Documentation - User Guide 11.1. Configuring the Virgo Kernel and User Region - http://www.eclipse.org/virgo/documentation/

Revision as of 05:44, 10 November 2010

Work in Progress...

@see Blog post Running RAP on Virgo

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

  • Packing your application into a WAR archive and deploying it on a standard servlet container such as Tomcat, or
  • 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 the latest Virgo Kernel (2.1.0.RELEASE)[1] and unpack the downloaded archive to a directory (We'll use ${KERNEL_HOME} in this post).

2. Download the latest RAP Runtime[2] 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 $KERNEL_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 HttpService

export 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:

<HD0001I> Hot deployer processing 'MODIFIED' event for file 'virgo-rap-demo.plan'.
<DE0000I> Installing plan 'virgo-rap-demo' version '1.3.1'.
<DE0000I> Installing plan 'vigo-equinox-extensions' version '3.6.1'.
<DE0000I> Installing plan 'virgo-rap-extensions' version '1.3.1'.
<DE0000I> Installing bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
<DE0000I> Installing bundle 'org.eclipse.osgi.services' version '3.2.100.v20100503'.
<DE0000I> Installing bundle 'org.eclipse.equinox.preferences' version '3.3.0.v20100503'.
<DE0000I> Installing bundle 'org.eclipse.equinox.app' version '1.3.1.R36x_v20100803'.
<DE0000I> Installing bundle 'org.eclipse.core.commands' version '3.6.0.I20100512-1500'.
...
<DE0004I> Starting bundle 'org.eclipse.rap.demo' version '1.3.1.20100915-2301'.
<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 ...

10. 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 http://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/

[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/

Back to the top