Eclipse - How can I change the “project edge” from Tomcat 6 to Tomcat 5.5?

(Eclipse 3.4, Ganymede)

I have an existing dynamic web application project in Eclipse. When I created the project, I indicated "Default Configuration for Apache Tomcat v6" in the "Configuration" drop-down list.

This is a month or 2 on the line, and now I would like to change the configuration to Tomcat 'v5.5'. (This will be the version of Tomcat on the production server.)

I tried the following steps (without success):

  • I selected Targeted Runtimes in the Properties project
    The Tomcat v5.5 was disabled and the user interface displayed this message:
    If the runtime you want to select is not displayed or is disabled you may need to uninstall one or more of the currently installed project facets.
  • Then I clicked the Uninstall Facets... link.
    On the Runtimes tab, only Tomcat 6 displayed.
    For Dynamic Web Module I chose version 2.4 instead of 2.5 .
    The Runtimes tab now displays Tomcat 5.5 .
    However, the user interface now displays this message:
    Cannot change version of project facet Dynamic Web Module to 2.4.
    The Finish button was disabled, so I reached a dead end.

I can successfully create a new project with Tomcat v5.5 configuration. For some reason, however, this will not allow me to downgrade the "existing project."

As a job, I created a new project and copied the source files from the old project. However, the detour was rather painful and somewhat awkward.

Can anyone explain how I can “downgrade” the project configuration from “Tomcat 6” to “Tomcat 5”? Or perhaps shed light on why this happened?

thank
Pete

+56
eclipse tomcat tomcat6 ganymede
Sep 16 '08 at 19:04
source share
7 answers

This is a kind of eclipse hack, and you may come across this, but this should work:

Open the navigator view and find that the .settings folder is in your project, and then open the file: org.eclipse.wst.common.project.facet.core.xml you will see a line that says: <installed facet="jst.web" version="2.5"/> Change it to 2.4 and save.

Just make sure your project does not use anything specific for 2.5, and you should be good.

Also check that your web.xml has the correct configuration:

 <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 
+87
Sep 16 '08 at 19:49
source share

It may be old, but I tried and found the following in Galilio's eclipse.

Open the navigator view and find that the .settings folder is in your project, and then open the file: org.eclipse.wst.common.project.facet.core.Delete the contents of this file and right-click in the project and click on properties. Go to the Projects section of the pop-up window where you can click the runtime tabs and convert your project into the new facet you want.

+7
Mar 01
source share

if you are using Maven, then close the eclipse, then enter >mvn eclipse:eclipse -Dwtpversion=2.0 and restart eclipse.

+5
Jan 28 '11 at 15:53
source share

Sorry, I can't seem to post a comment without enough Rep, so ...

I think it is too difficult for eclipse to safely degrade to a lower standard because it cannot really know if you used something from the newer web standard. Therefore, if this simply allows you to do this, it may cause your program to crash in an older version.

You can always be backward compatible, but not compatible with them.

0
Sep 16 '08 at 23:21
source share

You can try to uncheck, apply, change the facet value and check. It works for me on Eclipse Helios SR1.

So, the main difference is that I am doing this using the "Dynamic Web Module".

I hope this works for you too.

0
Oct 29 '10 at 11:44
source share

I saw the same thing, then I changed the version value of the web application in web.xml . This can fix it for you.

0
Apr 6 '11 at 19:20
source share

If you use maven, you can create eclipse settings using the maven eclipse plugin.

For the jst.web version, the Eclipse Maven eclipse takes project dependencies into account. If you have a servlet apl dependency installed:

 <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>servlet-api</artifactId> <version>6.0.32</version> </dependency> 

Jst.web parameter will be 6.0

 <faceted-project> ... <installed facet="jst.web" version="6.0"/> ... </faceted-project> 
-one
May 10 '11 at 20:55
source share



All Articles