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 the Author

author image
mkyong
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

avatar
22 Comment threads
2 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
24 Comment authors
vijayJosuehanibalckAnubhav BhatangarAbhay Recent comment authors
newest oldest most voted
vijay
Guest
vijay

still not working

Josue
Guest
Josue

THANKS SO MUCH DUDE¡¡

hanibalck
Guest
hanibalck

Muchas gracias!

Anubhav Bhatangar
Guest
Anubhav Bhatangar

The solution worked for me.

Thanks mkyong..!!!!

Abhay
Guest
Abhay

Thank you very much Problm solved…

Akash
Guest
Akash

Thank you! It worked :)

Ugur
Guest
Ugur

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
Guest
pr

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
Guest
Naman Gala

Thanks, problem solved.

Raymond Naseef
Guest
Raymond Naseef

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

pavan
Guest
pavan

Thnx …It helps me alot..

Zeus
Guest
Zeus

Works Great.

saikrishna
Guest
saikrishna

It worked correctly. Thanks.

Kevin
Guest
Kevin

Thanks. Your fix did the trick!

Markus
Guest
Markus

Thanks, problem solved.

DanT
Guest
DanT

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

Eze
Guest
Eze

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
Guest
zanwar501

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
Guest
sam

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

Suresh
Guest
Suresh

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
Guest
franjo

Thanks! good tip to step over this IDE limitation.

Antony Ho
Guest
Antony Ho

Works!

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

Cosmo
Guest
Cosmo

Thanks that got me out of a jam!!!