Home » Eclipse Projects » Remote Application Platform (RAP) » When I package my own Rap to Tomcat, It doesn't work.Why?(When I package my own Rap to Tomcat, It doesn't work.Why?)
|Re: When I package my own Rap to Tomcat, It doesn't work.Why? [message #539781 is a reply to message #539729]
||Sun, 13 June 2010 03:19
| tingel christian
Registered: December 2009
I wonder whether or not you have tried the following steps:
1, Open $APP_ROOT$/WEB_INF/web.xml
2, Find the "commandline" parameter name and change the value from "-console" to "-console 12345", and then save it;
3, start up Tomcat;
4, start a new cmd console;
5, Execute the following command in the new console:
telnet localhost 12345
6, input ss and enter;
7, Find your application ID and execute diag $APP_ID$
8, The console will tell you what's wrong with your application.
Have a nice Dragon Boat Festival.
Yours Tingel Christian
|zezhenyan wrote on Sat, 12 June 2010 17:33|
I think this extension doesn't work.
|Re: When I package my own Rap to Tomcat, It doesn't work.Why? [message #539881 is a reply to message #539787]
||Mon, 14 June 2010 07:58
| Martijn Cremer
Registered: January 2010
A quick runtrough to a guide i writen (lacking images) I hope this helps. This works on the latest RAP RC3.|
Getting RAP on your tomcat
I want to introduce you to RAP because I think RAP is the future. After I came back from an Eclipse RCP training, my boss asked me if we could make proof of concept of single sourcing with RAP. Well, you can imagine what I thought about single sourcing after just having learnt the Eclipse RCP way. But after only a week of reading up on RAP and trying it out I saw the benefit of RAP straight away. With just one set of projects and a few fragments depending on the Target, we had a nice single-sourced project that looked professional and was easy to maintain.
The only problem I had with RAP was the deployment of getting it running outside your own Eclipse environment and running it on a Tomcat server. It was a complex road and all the documentation I found was far outdated. This made my work only harder. I am not the only one having problems and as stated in the GOOGLE Summer Code Project proposal, the RAP forum is filled with questions about it. So the need from the user community is a good user-friendly, not overly complex system to deploy your RAP project. Now, its great news that we are going to have the "RAP/Equinox WAR products", but they will start only after the 24th of May and this means that for now we are sort of stuck with the old ways.
Now the main problem is that most info about war deployment you can find is a tad outdated. Open Source projects have the tendency to improve rapidly over time and thus a lot has to be kept up to date. This is a hassle sometimes. So its up to us, the users, to do that. So here is the updated version for you RAP users out there to deploy your own RAP project as a WAR file. Its done in two steps: step 1 we will just make the servlet bridge work (that's most of the work) and in step 2 we will try to make a RAP application work. I hope this will help all the RAP enthusiasts out there.
1. Just try getting the equinox bridge to work.
Firs step when having problems with getting your RAP working is getting the Equinox system working in your WAR container. Try downloading this Team project file.
<?xml version="1.0" encoding="UTF-8"?>
Note: if there is a question about user name pass use the username anonymous
Now normally this would be enough. But the guys from the RAP team created a great automated method for creating a WAR archive. So we are going to import it as well. You can use the following TEAM project:
<?xml version="1.0" encoding="UTF-8"?>
Copy the org.eclipse.rap.demo feature as org.eclipse.equinox.servlet.new.feature.
Copy the feature.xml from the old org.eclipse.equinox.servlet.feature so that you have the basics.
When you done that, unfold the templates folder - we need to edit it a bit. First off, open the web.xml we need to remove the <!-- --> comment out of the following text:
This will enable the OSGi console if you successfully deploy the WAR file to a server in its console. You can add a port number after the console if you want to telnet to it. Next, you change the false to true for the following part:
This will enable the controls of the framework trough the web interface. Read more about it here.
Remove the following parts:
<!-- Enable multi-language support for the extension registry -->
<!-- Framework Controls could be useful for testing purpose, but
we disable it in RAP environment per default -->
Now we go to the eclipse folder, edit launch.ini and change it as follows:
Note: you can read more about this in the Eclipse FAQ No. 105
What you need to do now is to edit the ant script in the script folder. Find the property webapp.name and features and change them to the following:
<property name="webapp.name" value="bridge" />
<property name="features" value="org.eclipse.equinox.servletbridge.new.feature" />
Now you can run the Ant script by going to Run>External Tools>External Tools configuration. Here you create a new launch configuration for the Ant builder. Go to the JRE tab and change the Runtime JRE to "Run the same JRE as Workspace". This will enable the antscript to use the PDE.Builder to build the bundles. Click on Run. The JRE will start and you will see PDE.Export running. Remember to refresh the feature project. You will see a BUILD folder been added. Now, unfold the scr folder till you have the ConfigIniCreator.java file. Open it and change the file location to:
Save the changes and run it - you will get the following output:
#Eclipse Runtime Configuration File
Copy this and go to build>bridge>WEB-INF>eclipse>configuration folder. Edit the config.ini file and paste in the generated output, Save it.
Now we got everything you need in a war file, it is just not there yet. Use any archive application you want and use the zip compression. Rename the zipped file to bridge.war and voila, you got yourself a Web Application Archive that is ready to be deployed to your servlet server.
2. Getting your RAP project on the tomcat.
First copy the org.eclipse.equinox.servlet.new.feature and name it to your liking.
First, a small reminder: if you are (as I was) single sourcing and set every RCP and RAP part to optional, the instructions in this manual will not work for you. Before making your product, check all your plugins and set the optional flag off for your RAP dependencies so that you can actually validate dependencies.
In the feature we add org.eclipse.rap.ui. Now we create a new product file trough file>new>product configuration. Set the product configuration to feature.
Go to the dependencies page and add the feature you created. Press the validate button.
You can see that there are some dependencies missing, for example javax.servlet, and javax.servlet.http. You only want to see those two (javax.servlet, and javax.servlet.http) missing. So add any missing constraint until you have the whole basic framework of RAP implemented. Add you application plugin and keep repeating the validation process till all the plugins you see are only missing the javax.servlet, and javax.servlet.http constraint. There is one exception to this rule - the org.eclipse.equinox.http.servletbridge wants org.eclipse.equinox.servletbridge, but you can ignore this as well.
When you are done, you can run the ant script again and zip the created WEB-INF to a zip/war file. Before you deploy this, undeploy the bridge.war if you have not done it already. And then deploy the war. If you want to put this on a production server, you will have to change the following in the web.xml of your deployable war so it will use less resources and give faster response:
There you have it. Until the summer code project is done and forms part of the RAP release, this will be the way to create your WAR files.
hm. I've lost a machine.. literally _lost_. it responds to ping, it works completely, I just can't figure out where in my apartment it is.
Current Time: Tue Dec 07 13:22:01 GMT 2021
Powered by FUDForum
. Page generated in 0.04028 seconds