Tomcat version 7.0 only supports J2EE 1.2, 1.3, 1.

2020-02-27 06:30发布

I'm trying to deploy a very simple HTTPServlet project using Tomcat 7 in my Eclipse J2EE perspective. I am getting the error "Tomcat version 7.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 and 6 Web modules". I have already tried modifying my org.eclipse.wst.common.project.facet.core.xml as mentioned here file but that doesn't seem to fix the issue. I'm able to deploy just fine by using file->export->.war directly to my installed tomcat server. Any ideas?

10条回答
放我归山
2楼-- · 2020-02-27 06:55

Go to Project Properties -> Project Facets and change the version of Dynamic Web Module. If it is set to 3.1 then change it to 3.0. In case it does not allow you to change the version, uncheck it and press apply. Then you can select the version, check it and apply-OK. Worked for me!

查看更多
Rolldiameter
3楼-- · 2020-02-27 06:55

1)Go to your project on folder in eclipse workspace.
2)Open the .setting folder
3)Open the "org.eclipse.wst.common.project.facet.core" xml file
4)Update the version in last line as 2.4 or 2.5
5)Refresh the project and try to run on server

查看更多
叛逆
4楼-- · 2020-02-27 06:57

For Tomcat Version 6

In project, .settings folder OR Or CTRL+SHIFT+R : find this file

org.eclipse.wst.common.project.facet.core.xml

change the version of facet=jst.web to 2.4 or 2.5

File : org.eclipse.wst.common.project.facet.core.xml

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <fixed facet="jst.java"/>
  <fixed facet="jst.web"/>
  <installed facet="jst.web" version="2.4"/>
  <installed facet="jst.java" version="6.0"/>
</faceted-project>

Tomcat 7 You need facet="jst.web" version="3.0" to deploy on Tomcat 7.

查看更多
疯言疯语
5楼-- · 2020-02-27 06:57

This problem can be resolved by by changing the Dynamic Web Module version to 3.0. This can be done in 2 ways.

  1. Goto project properties and click on project facets, now you see the option Dynamic Web Module, change it to 3.0

  2. For those who can't change the version in the above step, open org.eclipse.wst.common.project.facet.core.xml and change the version here to something like <installed facet="jst.web" version="3.0"/>

Now go to project facets and see the Dynamic Web Module version changed to 3.0

查看更多
6楼-- · 2020-02-27 07:00

For Tomcat 8.5 if you are facing this issue, change your facet setting to 3.1

Open file : {project_Folder}/.setting/org.eclipse.wst.common.project.facet.core

Open org.eclipse.wst.common.project.facet.core XML file. Change to version as 3.1 Save and refresh the project you will find it you can add the resource to tomcat.

This worked for me.. Thanks

查看更多
Evening l夕情丶
7楼-- · 2020-02-27 07:04

To Solve this Issue You will have to update your Dynamic Web Module version from 3.1 to 3.0. Eclipse dosen't allow these updation directly via Build Path-->Configure Build Path-->Project Facets.

Follow these steps Open file : YourPrjectFolder/.setting/org.eclipse.wst.common.project.facet.core

  1. In project folder, goto .settings folder.
  2. Open org.eclipse.wst.common.project.facet.core XML document.
  3. Edit line <installed facet="jst.web" version="3.1"/> to <installed facet="jst.web" version="3.0"/>
  4. Save the changes.
  5. Goto Eclipse and refresh the project.

You will be able to publish the your project now on Tomcat 7.

查看更多
登录 后发表回答