Main Tutorials

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.

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
26 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Pablo Silberkasten
3 years ago

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

Sethuraj
3 years ago

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

vijay
5 years ago

still not working

Josue
6 years ago

THANKS SO MUCH DUDE¡¡

hanibalck
6 years ago

Muchas gracias!

Anubhav Bhatangar
8 years ago

The solution worked for me.

Thanks mkyong..!!!!

Abhay
8 years ago

Thank you very much Problm solved…

Akash
9 years ago

Thank you! It worked 🙂

Ugur
9 years ago

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.

pr
9 years ago

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

Naman Gala
9 years ago

Thanks, problem solved.

Raymond Naseef
9 years ago

Wonderful, thank you. None other “answers” even mention facets or ‘jst.web’ – Great Job!

pavan
9 years ago

Thnx …It helps me alot..

Zeus
10 years ago

Works Great.

saikrishna
10 years ago

It worked correctly. Thanks.

Kevin
10 years ago

Thanks. Your fix did the trick!

Markus
10 years ago

Thanks, problem solved.

DanT
10 years ago

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

Eze
11 years ago

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!

zanwar501
11 years ago

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!

sam
11 years ago

I was able to get rid of this problem,Thanks for this post.

Suresh
11 years ago
Reply to  sam

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.

franjo
11 years ago

Thanks! good tip to step over this IDE limitation.

Antony Ho
11 years ago

Works!

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

Cosmo
11 years ago

Thanks that got me out of a jam!!!