Cornelia's Weblog

my sporadically shared thoughts on, well, whatever is capturing my attention at the moment.

Posts Tagged ‘eclipse’

All the little references when you copy an eclipse project

Okay, maybe I’m not supposed to copy eclipse projects this way, but I simply wanted to make a copy of an eclipse project that had already been appropriately configured to include a number of libraries, etc., so that I didn’t have to go through all that config again. Seems like it should work, intuitively, and I guess we’re close, but there were a few tweaks I had to make by hand to get everything up and running the way I wanted.Brief overview of my eclipse environment and project:

  • I am running eclipse V3.4.2 with WTP (and a couple other plugins that are inconsequential)
  • I’ve configured a Tomcat server so that I can run from within eclipse – i.e. Run As…->Run on Server
  • My project is a Dynamic Web Project

First thing I do after copying the project from, say, “MyProject” to “MyProject2″ is right click on the project, select Properties, go to Web Project Settings and update the Context Root; I want my new service to run at the URL …/services/MyProject2 instead of …/services/MyProject so I set the context root to MyProject2. I do a Project->Clean and then build the project and all looks fine. When I right-click Run As->Run on Server, select my Tomcat Server, click Next, here is the rub: Instead of showing MyProject2 in the list of configured projects I see MyProject listed twice. Turns out that I can select one of them and click the Remove All button, continue with the deployment (even with the old project name there) and everything runs on Tomcat as you would expect – the server responds to requests at url …/services/MyProject2.So the question is, why isn’t the new project name picked up in the right places? I believe it is because a key settings file is written at project creation time via the wtp plugins, and writes the project name into that file, but when I created the project via a copy of the old, eclipse does not update that file. I found the file, but try as I might I cannot find a config page anywhere that allows me to update it – I guess this is not too surprising as, in theory, this is just bound to the eclipse project name and it would be confusing for users to diverge from that naming convention (certainly is confusing me).The solution:The file is the org.eclipse.wst.common.component file that is in the / /.settings directory. Close eclipse, open that file (it’s an XML file) and update the line that reads:<wb-module deploy-name="MyProject">to<wb-module deploy-name="MyProject2">and start eclipse. At this point I had to do another Project->Clean and build (else the context root for the web project was a mess) and then the last thing you need to do is clean the Tomcat work directory by right clicking on the server in the “Servers” tab and selecting Clean Tomcat Work Directory… Now, try running the app again via Run As->Run on Server and when you’ve selected the server and clicked Next you will see both MyProject and MyProject2 in the Configured Projects list – not to worry, the MyProject is just a left over reference from the last time you ran the old project and can be removed by selecting and clicking Remove All.And now you’ve managed to update what I believe is the last reference to the old project name from your new project.

What happened to the FUSE->FUSE Project option in the eclipse plugin?

A colleague of mine was still running eclipse with an older version of the FUSE plugin – in particular 1.0.0. He had a single option under the New->Project->FUSE category called “FUSE Project”. Selecting this option created what was essentially a web services project (in particular we are using it for RESTful services) that had all of the libraries set up, etc.When I installed the latest version of everything, following the instructions in the FUSE installation guide that option was gone. Under the FUSE category there are now three options that are all essentially Camel focused – EIPs and the like. I did some digging and found that creating a web services project set up for FUSE (Service Mix – CXF) is now done via project options shipped with the Eclipse Web Tools Platform. Here’s how it works:Select File->New->Project and then under Web select Dynamic Web Project. Clicking “Next” presents the following dialog:Creating CXF ProjectUnder the Configuration section select the CXF Web Services Project v2.5 option and that’s it. Exporting this project to a war includes all of the necessary jars. This does, of course, require that you have set your CXF runtime preferences appropriately. In Windows->Preferences:Setting CXF Runtime ParametersThe only gotcha I ran into was that plugin installation order matters. It’s still not clear to me if and when WTP is included in Eclipse IDE for Java EE Developers – the WTP 3.1 Release page says it does with Galileo but I was constrained to using Ganymede for other plugin compatibility; installing Ganymede Eclipse IDE for Java EE Developers did NOT seem to include the WTP, at least not the CXF pieces. Assuming WTP has to be installed, and assuming I want to install the latest FUSE integration designer, you have to install WTP first. When I did the FUSE plugin first I had several problems, most notably there was no CXF 2.x Preferences option under the Web Services preferences (see screen shot above); this is an option that is added when you install the appropriate parts of the WTP.UPDATE 1/22/2010:I’ve just installed Galileo and while it does include WTP, it does not include the CXF portions. Go to the update sitehttp://download.eclipse.org/webtools/updatesand then expanding each of Web Tools Platform, Web Tools Platform SDK and Web Tools Platform Tests (optional) select the CXF pieces – there is one in each category.Installing CXF tools with WTP