Eclipse - 如何将Tomcat 6中的“项目方面”更改为Tomcat 5.5? [英] Eclipse - How can I change a 'Project Facet' from Tomcat 6 to Tomcat 5.5?

查看:477
本文介绍了Eclipse - 如何将Tomcat 6中的“项目方面”更改为Tomcat 5.5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(Eclipse 3.4,Ganymede)



我在Eclipse中有一个现有的动态Web应用程序项目。当我创建项目时,我在配置下拉列表中指定了Apache Tomcat v6的默认配置。



这是一个月或2个月,现在想将配置更改为Tomcat'v5.5'。 (这将是生产服务器上的Tomcat版本。)



我尝试了以下步骤(不成功):




  • 我在项目属性下选择了目标运行时
    Tomcat v5.5 选项已禁用,UI显示此消息:

    如果要运行时选择不显示或被禁用,您可能需要卸载一个或多个当前安装的项目构面。

  • 然后我点击卸载Facets ... 链接。

    Runtimes 选项卡下,只有 Tomcat 6 显示。

    对于动态Web模块,我选择版本 2.4 代替 2.5

    运行时选项卡下, Tomcat 5.5 现在显示。

    然而,UI现在显示此消息:

    无法将项目构面动态Web模块的版本更改为2.4

    完成按钮被禁用 - 所以我达到了死胡同。



    • 我可以使用Tomcat v5.5配置成功创建一个新项目。由于某种原因,它不会让我降级现有的项目。



      作为一个解决方法,我创建了一个新的项目,并将源文件从旧项目。任何人都可以解释我如何将Project配置从Tomcat 6降级为Tomcat 5,但是, ?或者可能是为什么会发生这样的事情?



      感谢

      Pete

      解决方案

      这是一个黑客eclipse,你可以遇到这样的麻烦,但这应该是有效的:



      打开导航器视图,找到您的项目下有一个.settings文件夹展开它,然后打开文件: org.eclipse.wst.common.project.facet.core.xml 你应该看到一行说:

      < installed facet =jst.webversion =2.5/>

      将其更改为2.4并保存。



      只需确保您的项目没有使用任何特定的2.5,你应该是好的。



      还要检查你的web.xml是否有正确的配置:

       < 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\">


      (Eclipse 3.4, Ganymede)

      I have an existing Dynamic Web Application project in Eclipse. When I created the project, I specified 'Default configuration for Apache Tomcat v6' under the 'Configuration' drop down.

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

      I have tried the following steps (without success):

      • I selected Targeted Runtimes under the Project Properties
        The Tomcat v5.5 option was disabled and The UI 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.
      • I then clicked on the Uninstall Facets... link.
        Under the Runtimes tab, only Tomcat 6 displayed.
        For Dynamic Web Module, I selected version 2.4 in place of 2.5.
        Under the Runtimes tab, Tomcat 5.5 now displayed.
        However, the UI now displayed 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 a Tomcat v5.5 configuration. For some reason, though, it will not let me downgrade' an existing Project.

      As a work-around, I created a new Project and copied the source files from the old Project. Nonetheless, the work-around was fairly painful and somewhat clumsy.

      Can anyone explain how I can 'downgrade' the Project configuration from 'Tomcat 6' to 'Tomcat 5'? Or perhaps shed some light on why this happened?

      Thanks
      Pete

      解决方案

      This is kind of hacking eclipse and you can get into trouble doing this but this should work:

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

      Just make sure that your project isn't using anything specific for 2.5 and you should be good.

      Also check 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">
      

      这篇关于Eclipse - 如何将Tomcat 6中的“项目方面”更改为Tomcat 5.5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆