Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Servlet Version Conflict
Servlet Version Conflict [message #222686] Fri, 17 October 2008 07:59 Go to next message
vallabh vaidya is currently offline vallabh vaidyaFriend
Messages: 2
Registered: July 2009
Junior Member
Hello friends,
I am new to J2EE. I was doing some homework and got one error.
I think know why this error is coming but i don't know how to remove it.
If anybody could help me!
I am using Eclipse Ganymede. The compiler compliance level is
1.6. Installed jre is jre1.6.0_01. I have J2ee5(with Sun Application
Server PE9) installed. When i created new Dynamic Web Project and added a
servlet there were some errors telling that 'HttpServlet' class couldn't
found. So I added 'javax.servlet_2.4.0.v200806031604' jar's reference to
my project(in the Build Path) and errors were gone.
After that I exported my dynamic project into .war file and
deployed it using Sun Application Server PE9. Everything worked fine. I
launched my application and requested the specific servlet and i got
following error: javax.servlet.ServletException: Error allocating a
servlet instance. java.lang.UnsupportedClassVersionError: Bad version
number in .class file.
I thought it's due to the compliance level and installed jre
version which is conflicting with the J2EE5. So I changed the installed
jre and compliance level to inbuilt jre which comes with J2EE. But still i
am getting the same error.
Re: Servlet Version Conflict [message #222694 is a reply to message #222686] Fri, 17 October 2008 13:00 Go to previous messageGo to next message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 201
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
The problem is that your servlet classes are build with JDK 1.6 using
compliance level 1.6, but your application server is running with JDK 1.5.
The easiest way to solve this problem is to right-click your Web project
then choose Properties > Project Facets and modify the version of the Java
facet: choose a lower level - 5.0 or 1.4. After you click OK, your project
will be rebuilt and it should deploy and run without problems.

Greetings,
Kaloyan

"vallabh vaidya" <vallabh_vaidya@yahoo.co.in> wrote in message
news:a70014298f60f2f498e603d5f4143e3d$1@www.eclipse.org...
> Hello friends,
> I am new to J2EE. I was doing some homework and got one error.
> I think know why this error is coming but i don't know how to remove it.
> If anybody could help me!
> I am using Eclipse Ganymede. The compiler compliance level is
> 1.6. Installed jre is jre1.6.0_01. I have J2ee5(with Sun Application
> Server PE9) installed. When i created new Dynamic Web Project and added a
> servlet there were some errors telling that 'HttpServlet' class couldn't
> found. So I added 'javax.servlet_2.4.0.v200806031604' jar's reference to
> my project(in the Build Path) and errors were gone.
> After that I exported my dynamic project into .war file and
> deployed it using Sun Application Server PE9. Everything worked fine. I
> launched my application and requested the specific servlet and i got
> following error: javax.servlet.ServletException: Error allocating a
> servlet instance. java.lang.UnsupportedClassVersionError: Bad version
> number in .class file.
> I thought it's due to the compliance level and installed jre
> version which is conflicting with the J2EE5. So I changed the installed
> jre and compliance level to inbuilt jre which comes with J2EE. But still i
> am getting the same error.
>
>
>
>
Re: Servlet Version Conflict [message #222705 is a reply to message #222694] Sat, 18 October 2008 04:55 Go to previous message
vallabh vaidya is currently offline vallabh vaidyaFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks Kaloyan,
As u told I changed the Project Facets to 5 and now
everything is working fine. Thank you very much for your quick reply.
Previous Topic:Wizard New SessionBean 2.1
Next Topic:jpa: change path to persistence.xml
Goto Forum:
  


Current Time: Fri Apr 26 12:40:01 GMT 2024

Powered by FUDForum. Page generated in 0.02905 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top