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.
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
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:
<tomcat>
/webapps. If not, make sure to select this option and the application will be directly deployed on Tomcat folder.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!
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.