Eclipse irreversible Dynamic Web Module 4.0 selection; Tomcat 9 doesn't support it

后端 未结 3 1105
别那么骄傲
别那么骄傲 2021-01-01 23:34

I\'m using Eclipse Oxygen.2 (4.7.2) on Windows 10 with Java 8. I have a faceted project I run inside Eclipse using Tomcat. I had been using Tomcat 8.5, but on a new system I

3条回答
  •  失恋的感觉
    2021-01-02 00:00

    I reproduced the problem in the same environment as yours. When I tried to regress from 4.0 back to 3.1 I got the following error:

    This blog provided the solution (which is a bit of a hack but it works):

    • Edit the file org.eclipse.wst.common.project.facet.core.xml in the project's .settings directory.
    • For the line containing facet="jst.web" version="4.0", change the version to 3.1.

    Also see this SO question: Dynamic Web Module 3.0 -- 3.1


    A couple of related issues:

    • It looks like something else may not be quite right with your setup to be getting that error "Tomcat version 9.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5, 6, 7, and 8 Web modules". Is your project configured to use Servlet 4.0? For my Maven project I had to add this dependency to the POM for Servlet 4.

    • Even after changing the Dynamic Web Module version to 3.1 my web app continued using version 4.0, so I'm not sure what that facet achieves.

提交回复
热议问题