• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error allocating a servlet instance

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I get the following error while running a servlet...

I have JDK 1.4 , JRE 1.4 in my system and also JRE 1.5 ...


exception

javax.servlet.ServletException: Error allocating a servlet instance
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:534)

root cause

java.lang.UnsupportedClassVersionError: com/abcd/WelcomeClass (Unsupported major.minor version 49.0)
java.lang.ClassLoader.defineClass0(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:537..........


Can any of you shed some light ....what could be the problem...

Regards
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you may have a class file that's corrupt or out-of-date.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think class version 49.0 is the one used by Java 5; maybe you're running it under 1.4. Try compiling it with the "-target 1.4" option.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

The Welcome class is nothing but the HelloServlet class code...

found in servlet-examples.

Also i have only JRE 1.5 and not JDK 1.5 in my system..

Regards
 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container in which you are running the servlet might be using JRE 1.4.
[ January 04, 2006: Message edited by: Reghu Ram T ]
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes JAVA_HOME is set to JDK 1.4...

and tomcat uses this...
 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set your home to JDK 1.5 or JRE 1.5
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks...I will change it and test ...

Regards
[ January 05, 2006: Message edited by: A Kumar ]
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I uninstalled the JRE 1.5 and changed the settings in the Eclipse workbench

It is working now...

Thank you...

Regards
AKumar
 
Passioner Erin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The above solution is the best one i.e recompiling the source when there are version differences

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"jaya ajay",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear,

Just to clarify, 'Jaya Ajay' is a common name here in India. Its not fictitious

Regards,
Ram.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ramprasad. You gotta admit it looks suspicious. Sort of as if I used "bear raeb".

Jaya, can you send me an email or PM to corrorborate?
 
Passioner Erin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends!!

I admit the name caused confusion and didn`t gone through the naming rules of the forum!!

But Whats there in the name?

Our main focus is to solve/support/discuss problems related to technology.

(I hope above words are taken in their own respect)
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Passioner",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with display names get deleted.

What's in a name? The invalid ones get deleted, that's what

Dave
[ August 18, 2006: Message edited by: David O'Meara ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David O'Meara:
What's in a name? The invalid ones get deleted, that's what


Indeed. In fact, this is your final warning. Please change your display name to one that is valid prior to your next post in order to avoid having your account disabled.

bear
Forum sheriff
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic