|Use "RAP Target Platform" as deployment platform or run an extra application server? [message #1399985]
||Sun, 13 July 2014 13:58
| Stefan Eidelloth
Registered: September 2011
I am new to RAP, web applications and OSGI and I am curious about how to deploy RAP applications on a server to make them available for end users.
My main question is if the purpose of the so called "RAP Target Platform" is
a) only testing?<br>
b) to be an independent deployment platform (= an alternative to an application server like Tomcat)?
The RAP documentation describes how to get an example running on the RAP Target Platform. However, I did not find a convenient way to actually deploy the RAP applications for end users. Should the end users actually access that "RAP Target Platform"?
I found some articles on how to deploy RAP applications, but most of them seem to be out of date and kind of complex. Please give me some hints on best practices and let me know about your experiences with deploying RAP applications.
I'll try to describe by current understanding and give some hints for people who wants to achieve the same. Please correct me if necessary. I already put some effort in each of the strategies described below but did not succeed yet. I am lost in all the possibilities and wondering how to go on. My aim is to convert an RCP application into an RAP application and deploy it on a windows server. Several end users will be able to control the application in their browser (="use a custom Eclipse editor as web application").
A. RAP Hello World example
- Download and unzip "Eclipse for RCP and RAP Developers": https://www.eclipse.org/downloads/
- Install a so called "RAP Target Platform" as it is stated here: http://eclipse.org/rap/developers-guide/devguide.php?topic=target-install.html&version=2.0
On the Eclipse welcome screen (Help > Welcome), go to Overview > Remote Application Platform. Choose Install Target Platform on the following page. In the upcoming dialog confirm the default values, which starts the target installation process. After the installation finished you are prepared to work with RAP. For your first steps you may try out some RAP Examples and/or write a Hello World Application.
- Follow the hello world example: http://eclipse.org/rap/developers-guide/devguide.php?topic=hello-world.html&version=2.0
- Open MANIFEST.FM and execute "Launch a RAP Application"
- A browser window appears and in my case it shows the hello world example application under "localhost:55551/hello". I can also but this url in another browser, e.g. Firefox and see the hello world example application.
B. How it works.
The "RAP Target Platform" seems to
- use Eclipse Equinox as an OSGI container
- run Jetty as an application container inside the OSGI container
- run RAP applications with/inside the Jetty container
The above process is one possibility to show an RAP application in my browser. If I close Eclipse the "RAP Target platform" will be closed and my application will not be available any more.
C. Possibilities for deployment
There seem to be two main possibilities to deploy RAP applications:
I. Use OSGI as a main container:<br>Set up an OSGI container, run an application server as an OSGI bundle inside that container and also run your application as OSGI bundle "inside the sub container". <br>
II. Use an application server as main container. Use an application server like Tomcat, but everything that is needed for the RAP application in a single *.war file and deploy that *.war file on the application server. The *.war file might include OSGI. (See for example http://eclipsesource.com/blogs/2007/12/07/rap-deployment-part-2-deploying-your-application-as-a-war-file/)
Currently the first approach seems to be more attractive to me. Several strategies come to my mind on how to achieve the deployment of an RAP application in an OSGI main container:
I a) Set up a minimalistic Equinox OSGI container as a windows service, using the Java Service Wrapper (http://wrapper.tanukisoftware.com/doc/english/download.jsp) or Procrun(https://commons.apache.org/proper/commons-daemon/procrun.html), install the required bundles for jetty and rap and finally the application bundle. New applications could be installed using the OSGI console.
I b) In order to handle the OSGI bundles more comfortably, install a minimalistic Eclipse version for the bundle mangagement (called "Platform runtime binaries"), install the Eclipse Plug-in Development Environment with http://download.eclipse.org/releases/luna/ to get the "plugin registry view". The OSGI console can be viewed inside the Eclipse console view. Go on with installing jetty bundles ect., like in I a). In order to deploy my application I would have to start this Eclipse instance and keep it running as a server. New applications could be installed like I am used to it in Eclipse with "install new software". (Is it possible to run the whole Eclipse instance as a Windows service?)
I c) Instead of manually installing all plugins, download the larger Eclipse for RCP and RAP Developers, use the Wizard to install the RAP Target Platform and directly use it as deployment platform (as already described in A.). (Again.. the Eclipse instance has to run the whole time the RAP application should be available for the end users).
I d) Use the Virgo Application Server for deployment. (search for "Deploying RAP Applications Made Simple Introducing the Virgo RAP Server"). This does not seem to work for Workbench applications yet.
Are there even more possibilities? Which one should I choose to go on with?
Powered by FUDForum
. Page generated in 0.02552 seconds