Tomcat version 7.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 and 6 Web modules

前端 未结 10 2059
离开以前
离开以前 2021-01-01 14:15

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.

相关标签:
10条回答
  • 2021-01-01 14:33

    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

    0 讨论(0)
  • 2021-01-01 14:39

    Tomcat is not a Java EE compliant application server, so you won't have EJB or CDI out-of-the-box here. Instead, use JBoss Wildfly or TomEE which are built on top of tomcat. Or, change to a complete different Java EE implementation like GlassFish.

    Another option may be if you deploy directly into Tomcat. Eclipse by default deploys on a different folder and use some kind of bypass to see it deployed on Tomcat. Follow these steps:

    1. In your Eclipse, go to the Servers view (if it's not visible in the IDE, go to Window/Show view/Servers), it will show you your tomcat server (and others), double click on it.
    2. In the Tomcat overview window, check the Server locations panel, expand it and check where the webapp is deployed.
    3. If selected option is Use Tomcat installation then the web app must be in <tomcat>/webapps. If not, make sure to select this option and the application will be directly deployed on Tomcat folder.
    0 讨论(0)
  • 2021-01-01 14:39

    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!

    0 讨论(0)
  • 2021-01-01 14:43

    If you are getting "Tomcat version 7.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 and 6 Web modules" error when trying to add project to Tomcat 7. Simply,

    Right click on the project --> go to project facets --> uncheck the dymanic web module (which should be 3.1)--> apply --> then change the dynamic web module to 3.0 --> apply and then save.

    Try to add now and it should work.

    0 讨论(0)
提交回复
热议问题