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?)
When I package my own Rap to Tomcat, It doesn't work.Why? [message #539262] |
Thu, 10 June 2010 08:26 |
zezhenyan Messages: 16 Registered: March 2010 |
Junior Member |
|
|
hi,
I want to change the my own rap project web container for Tomcat.
I have learned the example:
RAP Developer Guide->Advanced Topics->WAR Deployment
I followed this example, but I can show my Rap project.
The differences of my Rap project:
eclipse.rap.demo : only one plug-in project
my own rap: 9 plug-in projects
I can only show home page in the Tomcat. no other plug-in projects
What's the reason?
Thanks
Tyki
[Updated on: Thu, 10 June 2010 08:27] Report message to a moderator
|
|
| | | | | |
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 Messages: 46 Registered: December 2009 |
Member |
|
|
Hi zezhenyan:
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 | "org.eclipse.rap.ui.themes"
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 |
|
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"?>
<psf version="2.0">
<provider id="org.eclipse.team.cvs.core.cvsnature">
<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/tools,org.eclipse.orbit/javax.servlet,javax.servlet,v2_5"/>
<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/server-side/bundles/org.eclipse.equinox.http.registry,org.eclipse.equinox.http.registry"/>
<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http.servlet,org.eclipse.equinox.http.servlet"/>
<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/server-side/bundles/org.eclipse.equinox.http.servletbridge,org.eclipse.equinox.http.servletbridge"/>
<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/server-side/bundles/org.eclipse.equinox.servletbridge,org.eclipse.equinox.servletbridge"/>
<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/eclipse,equinox-incubator/org.eclipse.equinox.servletbridge.feature,org.eclipse.equinox.servletbridge.feature"/>
<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/eclipse,org.eclipse.update.configurator,org.eclipse.update.configurator"/>
</provider>
</psf>
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"?>
<psf version="2.0">
<provider id="org.eclipse.team.cvs.core.cvsnature">
<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/rt,org.eclipse.rap/releng/org.eclipse.rap.demo.feature,org.eclipse.rap.demo.feature"/>
</provider>
</psf>
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:
<init-param>
<param-name>commandline</param-name>
<param-value>-console</param-value>
</init-param>
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:
<init-param>
<param-name>enableFrameworkControls</param-name>
<param-value>true</param-value>
</init-param>
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 -->
<init-param>
<param-name>commandline</param-name>
<param-value>-registryMultiLanguage</param-value>
</init-param>
<!-- 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:
osgi.parentClassloader=app
osgi.contextClassLoaderParent=app
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:
{Projectfolder}\\org.eclipse.equinox.servletbridge.new.featu re\\build\\bridge\\WEB-INF\\eclipse\\plugins
Save the changes and run it - you will get the following output:
#Eclipse Runtime Configuration File
osgi.bundles= org.eclipse.equinox.common@2:start,\
org.eclipse.equinox.http.registry@start,\
org.eclipse.equinox.http.servletbridge@start,\
org.eclipse.equinox.http.servlet@start,\
org.eclipse.equinox.registry@start,\
osgi.bundles.defaultStartLevel=4
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:
<!--
<init-param>
<param-name>commandline</param-name>
<param-value>-console</param-value>
</init-param>
-->
<init-param>
<param-name>enableFrameworkControls</param-name>
<param-value>false</param-value>
</init-param>
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.
|
|
|
Goto Forum:
Current Time: Sat Dec 14 08:21:26 GMT 2024
Powered by FUDForum. Page generated in 0.04794 seconds
|