Eclipse IDE – Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules

Problem

Import a Java web project in Eclipse, build with Maven, once create a Tomcat server instance, unable to add the Java web project, and showing


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

Tools used :

  1. Eclipse Juno 4.2
  2. Tomcat 6.0.35
  3. JDK 1.6

Solution

In project, “.settings” folder, 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.

26 comments on “Eclipse IDE – Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules

  1. Thank you very much, you saved me a few day’s work of debugging.

    Reply
  2. It is working well for me. Thanks for your tips.

    Reply
  3. The solution worked for me.

    Thanks mkyong..!!!!

    Reply
  4. There is another case that error could happen : when project is java 6+ and tomcat runtime configured to run with jre 5. Changing configuration of the jre in the tomcat runtime configuration to jre6 or greater solve the problem in this case.

    Reply
  5. i got the same error , tried the solution did not work … using Spring STS 3.6.3 , is there something to do with the version of IDE

    Reply
  6. Thank you very much. Seems like you have the answers for most of my problems. Your work is greatly appreciated!

    Reply
  7. Hi, how can I automate this by just using the mvn clipse:eclipse -Dwtpversion=X.X ? I don’t want to have “extra configurations” besides that command. Is this possible ?
    thanks!

    Reply
  8. Struts2 tiles application runs fine in eclipse helios. When opened with eclipse Juno it gives exception:

    Juno downloaded from here.

    http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/SR1/eclipse-jee-juno-SR1-win32.zip&url=http://mirror.yongbok.net/eclipse//technology/epp/downloads/release/juno/SR1/eclipse-jee-juno-SR1-win32.zip&mirror_id=1078

    Exception here. Tomcat version 6.

    Caught Exception while registering Interceptor class org.apache.struts2.interceptor.debugging.DebuggingInterceptor – interceptor – jar:file:/C:/Users/Zafar%20Anwar/workspaceStruts2/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/Lab11Book(Struts2Tiles2Example)/WEB-INF/lib/struts2-core-2.0.11.2.jar!/struts-default.xml:98:115
    at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:78)
    at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:57)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:905)

    Could you please let me know what could be the reason and how to fix it?

    Thanks so much!

    Reply
    1. I have the same error. tomcat7 works but it runs in outofmemory errors since my app is huge, but I want to make it work for tomcat 6.

      I don’t have a file by name ‘org.eclipse.wst.common.project.facet.core.xml’ in the .settigns folder. Am I missing something, I do have Eclipse Juno.

      Reply
  9. Works!

    But actually you may change “Dynamic Web Module” by right click on the project->Properties->Project Facets

    Reply
    1. No, that option is disabled, unable to change. I have to update the XML file manually.

      Reply

Leave a Comment

Your email address will not be published. Required fields are marked *