Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Need example to deploy a RAP 2.1 app on Tomcat server(Need a complete example to deploy a new RAP 2.1 application on a Tomcat server)
Need example to deploy a RAP 2.1 app on Tomcat server [message #1066617] Wed, 03 July 2013 13:13 Go to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
Hi all,

I need an example of a RAP project to deploy on a tomcat server.
I would like work with the new target RAP 2.1 (official release) with a new Eclipse Kepler 4.3 (June 2013)

My Environment
Java JVM 7
Eclipse Kepler 4.3
WindowBuilderPro (for RWT: SWT Designer from http://download.eclipse.org/windowbuilder/WB/release/R201306261200/4.3/)
War Product Plugin last version (0.3.0.201305311343 from http://download.eclipse.org/releases/kepler)

My available servers
Tomcat 5.5.17
Tomcat 6.0.32
Tomcat 7.0.10
Tomcat 7.0.39
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1066618 is a reply to message #1066617] Wed, 03 July 2013 13:17 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
Today, I know how to create a new RAP project with the RAP target 2.1 (release of June 2013)
I can start my new project with Jetty into my Eclipse Kepler environment
I cannot start my product (war) with a Tomcat server (local Windows desktop)
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1066623 is a reply to message #1066617] Wed, 03 July 2013 13:32 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
In the attachment file, you'll find two projects:
- MyApp (Rap 2.1 Project - the main application)
- MyCommon (a plugin with the future common RAP features for the current "MyApp" and the future other RAP applications)
Note: MyApp is just a Hello World application... (to reduce the size of the project)

To run this application into Eclipse Kepler;
You must right-click on the MyApp project and "Run As > RAP application"

The entry point of my application is the following path:
http://127.0.0.1:52772/myapp
Note about the port: it's a generated port by eclipse (but you can fix it into the launching file)

The launching configuration is described into the "MyApp.launch" file
The war product to create a new war is the "mywar.warproduct" file



I know how create, deploy and use a war file (RAP 1.5.X) on tomcat
create => war product plugin
deploy => start the tomcat server
use => call the URL of my application
For example in RAP 1.5.X with a custom theme (id: customTheme), the url was
http://127.0.0.1:52772/myapp/customTheme

Now: how to run a "correct" war file (RAP 2.1) on a tomcat server?
I don't know.

Please, Help me
Thanks in advance
  • Attachment: ng.zip
    (Size: 50.53KB, Downloaded 47 times)
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1066962 is a reply to message #1066623] Fri, 05 July 2013 09:00 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

Hi,

you didn't explain the problem so far. Didn't you manage to export a war
file? Did you export a war but it didn't work?

In case you re-used an existing war products file from an earlier
version, you could try to delete it and create a new one from a working
launch config.

Regards,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067019 is a reply to message #1066962] Fri, 05 July 2013 13:08 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
I can create a war file with the "War Product Plugin"

But I cannot use this war with a tomcat server because, the response of this server is always: 404

Example with a Tomcat 5.5.17

1/ After creation of the war file "mywar.war" (Eclipse > War Product > config > Wizard to create a new war)
2/ I deploy the war file on my tomcat server (local desktop)
3/ I got a new "mywar" folder in my tomcat server (C:\...\apache-tomcat-5.5.17\webapps)
4/ I call my application with the following URL:
http://127.0.0.1/mywar

5/ The response is:
HTTP Status 404 - ProxyServlet: /mywar

type Status report

message ProxyServlet: /mywar

description The requested resource (ProxyServlet: /mywar) is not available.
Apache Tomcat/5.5.17


Note: into Eclipse with Jetty,
http://127.0.0.1/mywar shows my application!?
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067020 is a reply to message #1066617] Fri, 05 July 2013 13:11 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
I can create a war file with the "War Product Plugin"

But I cannot use this war with a tomcat server because, the response of this server is always: 404

Example with a Tomcat 5.5.17

1/ After creation of the war file "mywar.war" (Eclipse > War Product > config > Wizard to create a new war)
2/ I deploy the war file on my tomcat server (local desktop)
3/ I got a new "mywar" folder in my tomcat server (C:\...\apache-tomcat-5.5.17\webapps)
4/ I call my application with the following URL:
http://127.0.0.1/mywar

5/ The response is:
HTTP Status 404 - ProxyServlet: /mywar

type Status report

message ProxyServlet: /mywar

description The requested resource (ProxyServlet: /mywar) is not available.
Apache Tomcat/5.5.17


Note: into Eclipse with Jetty,
http://127.0.0.1/mywar shows my application!?
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067025 is a reply to message #1066617] Fri, 05 July 2013 13:24 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
Simple question:
How to call my application after deployment?

http://localhost/MyApp doesn't work
if "localhost" is a Tomcat Server
I receive an error "404"

http://localhost/MyApp works
if "localhost" is the Jetty Server (from my Eclipse Kelper Environment)
I see my application...
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067063 is a reply to message #1067025] Fri, 05 July 2013 15:54 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

In a tomcat deployment, every web application has a context path. If
your war file is named 'foo.war', the context path should be 'foo/'. So
instead of http://localhost/MyApp, you have to use the URL
http://localhost/foo/MyApp.

HTH,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067270 is a reply to message #1067063] Mon, 08 July 2013 07:35 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
Ralf Sternberg wrote on Fri, 05 July 2013 11:54
In a tomcat deployment, every web application has a context path. If
your war file is named 'foo.war', the context path should be 'foo/'. So
instead of http://localhost/MyApp, you have to use the URL
http://localhost/foo/MyApp.

HTH,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/


Ok - I know that but I don't understand why the response of my server is always:
HTTP Status 404 - /mywar/myapp

I tried with others names of war file (for other paths) and I got always the same response:
HTTP Status 404 - /XXXXXX/myapp

XXXXXX for other paths (wars file names)


Thank you anyway for the time you spend here
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067274 is a reply to message #1067270] Mon, 08 July 2013 07:52 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1839
Registered: July 2009
Senior Member
Hi Francis,
please ensure that all the bundles are in active state after deployment.
To do so, enable OSGi console in web.xml (remove the comment from
console command line parameter) and use "ss" command to list your
bundles. Post the output of the command here.
Best,
Ivan

On 7/8/2013 10:35 AM, Francis Delsinnes wrote:
> Ralf Sternberg wrote on Fri, 05 July 2013 11:54
>> In a tomcat deployment, every web application has a context path. If
>> your war file is named 'foo.war', the context path should be 'foo/'.
>> So instead of http://localhost/MyApp, you have to use the URL
>> http://localhost/foo/MyApp.
>>
>> HTH,
>> Ralf
>>
>> --
>> Ralf Sternberg
>>
>> Twitter: @EclipseRAP
>> Blog: http://eclipsesource.com/blogs/
>>
>> Professional services for RAP and RCP?
>> http://eclipsesource.com/services/rap/
>
>
> Ok - I know that but I don't understand why the response of my server
> is always:
> HTTP Status 404 - /mywar/myapp
>
> I tried with others names of war file (for other paths) and I got
> always the same response:
> HTTP Status 404 - /XXXXXX/myapp
>
> XXXXXX for other paths (wars file names)
>
> Thank you anyway for the time you spend here

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067357 is a reply to message #1066617] Mon, 08 July 2013 12:02 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
Ok, I found the problem.
New rap target 2.1 is not compatible with Tomcat 5.5.17
With a 6.0.32, the product works fine.
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067361 is a reply to message #1066617] Mon, 08 July 2013 12:08 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
I've modified "mywar.warproduct" like that:

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product useFeatures="false" includeLaunchers="false">
   <plugins>
      <plugin id="javax.xml"/>
      <plugin id="myApp"/>
      <plugin id="myCommon"/>
      <plugin id="org.apache.felix.gogo.command"/>
      <plugin id="org.apache.felix.gogo.runtime"/>
      <plugin id="org.apache.felix.gogo.shell"/>
      <plugin id="org.eclipse.core.commands"/>
      <plugin id="org.eclipse.core.contenttype"/>
      <plugin id="org.eclipse.core.jobs"/>
      <plugin id="org.eclipse.core.runtime"/>
      <plugin id="org.eclipse.equinox.app"/>
      <plugin id="org.eclipse.equinox.common"/>
      <plugin id="org.eclipse.equinox.console"/>
      <plugin id="org.eclipse.equinox.ds"/>
      <plugin id="org.eclipse.equinox.http.registry"/>
      <plugin id="org.eclipse.equinox.http.servlet"/>
      <plugin id="org.eclipse.equinox.http.servletbridge"/>
      <plugin id="org.eclipse.equinox.preferences"/>
      <plugin id="org.eclipse.equinox.registry"/>
      <plugin id="org.eclipse.equinox.servletbridge"/>
      <plugin id="org.eclipse.equinox.util"/>
      <plugin id="org.eclipse.osgi"/>
      <plugin id="org.eclipse.osgi.services"/>
      <plugin id="org.eclipse.rap.jface"/>
      <plugin id="org.eclipse.rap.rwt"/>
      <plugin id="org.eclipse.rap.rwt.osgi"/>
   </plugins>

   <configurations>
      <plugin id="javax.xml" autoStart="true" startLevel="0" />
      <plugin id="myApp" autoStart="true" startLevel="0" />
      <plugin id="myCommon" autoStart="true" startLevel="0" />
      <plugin id="org.apache.felix.gogo.command" autoStart="true" startLevel="0" />
      <plugin id="org.apache.felix.gogo.runtime" autoStart="true" startLevel="0" />
      <plugin id="org.apache.felix.gogo.shell" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.core.commands" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.core.contenttype" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.core.jobs" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.app" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.console" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.http.registry" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.http.servlet" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.http.servletbridge" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.preferences" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.registry" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.servletbridge" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.util" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.osgi" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.osgi.services" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.rap.jface" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.rap.rwt" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.rap.rwt.osgi" autoStart="true" startLevel="0" />
   </configurations>

   <warConfiguration webXml="/MyApp/WEB-INF/web.xml" launchIni="/MyApp/WEB-INF/launch.ini">
   <libraries>
      <library path="org.eclipse.equinox.servletbridge_1.2.300.v20130508-1243.jar" fromTarget="true"/>
   </libraries>
   </warConfiguration>
</product>

Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067399 is a reply to message #1067357] Mon, 08 July 2013 14:08 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1839
Registered: July 2009
Senior Member
Francis,
are you using the RAP 2.1 release? There was a problem with RC2 related
to the fix for bug:
408656: HttpOnly flag for settingStore cookie
https://bugs.eclipse.org/bugs/show_bug.cgi?id=408656
We reverted this fix in RC3+ in order to keep compatibility with servlet
2.5 (Tomcat 5.5.17). With RAP 2.1 release your application should work
fine with Tomcat 5.5.17.
Best,
Ivan

On 7/8/2013 3:02 PM, Francis Delsinnes wrote:
> Ok, I found the problem.
> New rap target 2.1 is not compatible with Tomcat 5.5.17
> With a 6.0.32, the product works fine.

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067497 is a reply to message #1067357] Tue, 09 July 2013 06:17 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

Our demos running on a Tomcat 5.5.20. So that can't be the problem.

Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Need example to deploy a RAP 2.1 app on Tomcat server [message #1067520 is a reply to message #1067399] Tue, 09 July 2013 08:24 Go to previous message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
Ivan Furnadjiev wrote on Mon, 08 July 2013 10:08
Francis,
are you using the RAP 2.1 release? There was a problem with RC2 related
to the fix for bug:
408656: HttpOnly flag for settingStore cookie
https://bugs.eclipse.org/bugs/show_bug.cgi?id=408656
We reverted this fix in RC3+ in order to keep compatibility with servlet
2.5 (Tomcat 5.5.17). With RAP 2.1 release your application should work
fine with Tomcat 5.5.17.
Best,
Ivan

On 7/8/2013 3:02 PM, Francis Delsinnes wrote:
> Ok, I found the problem.
> New rap target 2.1 is not compatible with Tomcat 5.5.17
> With a 6.0.32, the product works fine.

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/


Yes, I use the official release of RAP Target
2.1 Release
based on Eclipse 4.3
Published: June 26, 2013
From the Software site: http://download.eclipse.org/rt/rap/2.1

If you want test it, you can download my project (see the third post in the current topic)
Previous Topic:Migrating to RAP 2.1-RC3: Extending behaviour of DateTime widget
Next Topic:RAP-2.1 How to display image on the loading page?
Goto Forum:
  


Current Time: Tue Oct 21 05:31:34 GMT 2014

Powered by FUDForum. Page generated in 0.02549 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software