Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » ECP RAP demo in Tomcat(a set of steps to deploy the EMF RAP demo in Tomcat)
ECP RAP demo in Tomcat [message #1258520] Thu, 27 February 2014 13:16 Go to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
I encountered a few problems before successfully getting the ECP RAP demo deployed and running as a .war file on tomcat, so I thought I would document here what I found to save time for anyone else doing the same.
Note:

1.) I am using eclipse kepler , and tomcat 7.0.52 (I couldn't get this working with tomcat 8 )

2.) I have been using the ecp source code checked out from git, I have been using the release_1.2.0 branch

3.) I used "WAR products 0.3" from the kepler eclipse distribution, I installed this into my IDE.

First select the supplied ECP RAP target, and compile the code. Some of the ecp projects that are not needed for RAP will not compile, this is fine.

create a new plugin project. click on this new project.

From eclipse choose new->other->plugin developement -> WAR Product configuration.
In the wizard that appears you can choose "use existing launch configuraton" and choose the launch configuration for ECP RAP demo which is at currently called ecpDevelopementDemo. supply a file name where asked and click finish,

The .warproduct file opens,

edit the web.xml file if you wish to have better debugging.

I like to uncomment the -console section in the Web.XML so that I can use the output window of tomcat as an osgi console (note that you wont see this output window if yous tart tomcat as a service, but I believe there are other ways to access the osgi console)

on the opened .warproduct file click "eclipse war product export wizard" and choose a name and location for your war file.

At this point you may well see an error about cycles,for example:

A cycle was detected when generating the classpath org.eclipse.emf.ecp.core_1.2.0.201402271226,
org.eclipse.emf.ecp.emfstore.core_1.2.0.201402271226, org.eclipse.emf.ecp.core_1.2.0.201402271226.

This is because certain test plugin fragments exist,which the war product believes introduce dependancy cycles. So I close all used projects that end in .test,and try again, and then I don't see any of these cycle errors. I did try using a seperate war products distribution that claims to get around the cycles errors but this didnt make any difference.

You can then deploy this war file to Tomcat.

Note that the plugins get stored in tomcats "work" directory and they get cached there even when the tomcat server is stopped and started. THese plugins in the work directory are started when tomcat starts, so you should be careful to delete the contents of the work directory before deploying the war file if you change the list of plugins that you want to be active.

Note that custom .viewmodel files (which allow custom layouts of model elements) don't seem to get included in the war file. I haven't found a way around this yet.

If you have installed the JST server components into your IDE, you can also run tomcat easily in debug mode from your IDE.

Regards,
Neil


[Updated on: Thu, 27 February 2014 14:03]

Report message to a moderator

Re: ECP RAP demo in Tomcat [message #1384175 is a reply to message #1258520] Wed, 28 May 2014 10:15 Go to previous messageGo to next message
Simon Moissl is currently offline Simon MoisslFriend
Messages: 1
Registered: May 2014
Junior Member
Hi Neil,

thanks for your great documentation!

I tried to reproduce your steps, but I failed early when trying to deploy the ecpRAP.target. I imported all the ecp source projects as mentioned by you into my workspace and when setting the target at most a handfull of projects are compiling successfully as too many libraries are missing in the target (obviously I'm missing something?).
Could you provide your target file or tell me the changes you have made to the one in the repository?

Thanks in advance!

Regards,
Simon
Re: ECP RAP demo in Tomcat [message #1384260 is a reply to message #1384175] Wed, 28 May 2014 14:43 Go to previous messageGo to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
Hi Simon, I tried this with 1.2, I guess the target will have changed since then. I will try the process today with 1.3 RC1 and see if I can get it working like before, and will let you know.
Re: ECP RAP demo in Tomcat [message #1384621 is a reply to message #1384260] Thu, 29 May 2014 15:55 Go to previous messageGo to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
Hi Simon,
I managed to compile 1.3RC1 ok after making a small change to the target definition (I have raised a bug report and described the change in for this as https://bugs.eclipse.org/bugs/show_bug.cgi?id=436181).almost every project compliled, the ones for the java fx client did not but that is fine (I am sure they will compile if the fx target is selected).
I was using the source code from git with the 1.3.0.RC1 tag.

I could not run the app from the existing launch file (and the making a war file for tomcat depends on this launch file). I have created a launch file that works for me...this is described in bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=436185 .

I will try running through my previous steps to get this onto tomcat and let you know how i get on. Let me know if you have problems compiling... it took me quite a while to get it right as I made at least the following mistakes:
using an old target (its important to reload the target when changing between different working directories in git, and hence different versions of the target)
originally I imported the projects while a different tag was my working directory, then changed to checkout the 1.3.0.RC1 and didn't import new projects from that tag which didn't exist before.
I got confused between 1.3.0 release and 1.3.0 RC1 tag (which I think are slightly different)
Best of luck,
Neil
Re: ECP RAP demo in Tomcat [message #1386284 is a reply to message #1384621] Mon, 16 June 2014 11:01 Go to previous messageGo to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
This approach works now with the current master branch on git(which is for 1.3) and using Luna eclipse (i am using luna rc3) and the ecpdevelopementdemo launch script (make sure you have installed rap tools to see see this launch script). note that its best to start tomcat on a port other than 8080 as this is the port emfstore uses by default. When the application starts (and I can see the full gui) I still see one error in that it cannot start the emfstore components complaining in the log file that "org.osgi.framework.BundleException: Could not resolve module: org.eclipse.emf.emfstore.server [85]
Unresolved requirement: Require-Bundle: javax.servlet; bundle-version="[3.0.0,4.0.0)"
" this may be due to my version of tomcat , I will investigate a bit further.
other points to note:
if you called your war file ecpwar.war (for example) then the URL for a local tomcat on port 8081 will be localhost:8081/ecpwar/ecpWeb the capital W in ecpWeb is important.
the log file is at apache-tomcat\work\Catalina\localhost\ecpwar\eclipse\workspace\.metadata (if you called your war file ecpwar.war likeI did)
Re: ECP RAP demo in Tomcat [message #1386658 is a reply to message #1386284] Thu, 19 June 2014 09:06 Go to previous messageGo to next message
Neil Mackenzie is currently offline Neil MackenzieFriend
Messages: 131
Registered: December 2013
Senior Member
The reason I could not get ecp started in tomcat with the error " Unresolved requirement: Require-Bundle: javax.servlet; bundle-version="[3.0.0,4.0.0)" " is now documented along with a simple fix in bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=437730
Re: ECP RAP demo in Tomcat [message #1387001 is a reply to message #1386658] Mon, 23 June 2014 12:50 Go to previous message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 253
Registered: July 2009
Senior Member
Hi Neil,

thank you for documenting your solution, we will change this in EMFStore!

Cheers,
Maximilian

Am 19.06.2014 11:06, schrieb Neil Mackenzie:
> The reason I could not get ecp started in tomcat with the error "
> Unresolved requirement: Require-Bundle: javax.servlet;
> bundle-version="[3.0.0,4.0.0)" " is now documented along with a simple
> fix in bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=437730
>


--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Previous Topic:Target platform for ECP and RAP
Next Topic:html/ nice text in EMFForms
Goto Forum:
  


Current Time: Tue Mar 19 04:22:42 GMT 2024

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

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

Back to the top