Author
Error allocating a servlet instance
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
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
Joined: Jan 10, 2002
Posts: 56183
Looks like you may have a class file that's corrupt or out-of-date.
[Smart Questions ] [JSP FAQ ] [Books by Bear ] [Bear's FrontMan ] [About Bear ]
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35240
posted Jan 04, 2006 16:22:00
0
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.
Android apps – ImageJ plugins – Java web charts
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
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
Joined: Oct 21, 2003
Posts: 193
The container in which you are running the servlet might be using JRE 1.4. [ January 04, 2006: Message edited by: Reghu Ram T ]
Cheers,<br />Reghu Ram T<br /> <br />SCJP 1.4 - 98 %, SCBCD 1.3 - 94 %, SCMAD 1.0 - 92 %
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
Yes JAVA_HOME is set to JDK 1.4... and tomcat uses this...
Reghu Ram Thanumalayan
Ranch Hand
Joined: Oct 21, 2003
Posts: 193
Set your home to JDK 1.5 or JRE 1.5
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
Thanks...I will change it and test ... Regards [ January 05, 2006: Message edited by: A Kumar ]
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
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
Joined: Jun 15, 2006
Posts: 4
posted Jun 15, 2006 03:15:00
0
The above solution is the best one i.e recompiling the source when there are version differences Thanks
With Regards<br />Passioner<br />Live with Passion!!
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56183
"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
Joined: Jan 24, 2005
Posts: 489
Bear, Just to clarify, 'Jaya Ajay' is a common name here in India. Its not fictitious Regards, Ram.
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56183
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
Joined: Jun 15, 2006
Posts: 4
posted Aug 18, 2006 00:14:00
0
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
Joined: Mar 06, 2001
Posts: 13459
posted Aug 18, 2006 00:25:00
0
"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
Joined: Jan 10, 2002
Posts: 56183
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
subject: Error allocating a servlet instance