Tomcat Error-HTTP Status code 500


 
Thread Tools Search this Thread
Operating Systems Solaris Tomcat Error-HTTP Status code 500
# 1  
Old 08-17-2009
Tomcat Error-HTTP Status code 500

when I typed path http://localhost:8080/MyFirst/HelloWorld in web-browser ,it came up with error
Code:
HTTP Status 500 - 

type Exception report
message 
description The server encountered an internal error () that prevented it from fulfilling this request.
exception 
javax.servlet.ServletException: Error allocating a servlet instance
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
	org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	java.lang.Thread.run(Thread.java:595)
root cause 
java.lang.UnsupportedClassVersionError: Bad version number in .class file
	java.lang.ClassLoader.defineClass1(Native Method)
	java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1876)
	org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:889)
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1353)
	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
	org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	java.lang.Thread.run(Thread.java:595)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.

Files I placed in tomcat directory is web.xml in WEB-INF Directory, MyFirst.xml in /opt/apache-tomcat-5.5.27/conf/Catalina/localhost direcotry and HelloWorld.class in /opt/apache-tomcat-5.5.27/webapps/MyFirst/WEB-INF/classes directory

Code:
web.xml 
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<servlet>
        <servlet-name>HelloWorld</servlet-name>
        <servlet-class>HelloWorld</servlet-class>
</servlet>

<servlet-mapping>
        <servlet-name>HelloWorld</servlet-name>
        <url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>

</web-app>

Code:
MyFirst.xml
<!-- MyFirst Context -->
<Context path="/MyFirst" docBase="MyFirst" debug="0" reloadable="true"/>

Code:
HelloWorld.java
File Edit Options Buffers Tools Java Help                                                                              
// Filename : HelloWorld.java                                                                                          
// Description : This servlet merely says hello!                                                                       


import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWorld extends HttpServlet {

    public void doGet ( HttpServletRequest request, HttpServletResponse response )
        throws ServletException, IOException    {

        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        out.println("<html>");
        out.println("<head><title>Hello, Cruel World!</title></head>");
        out.println("<body>");
        out.println("<h1>Hello, Cruel World !</h1>");
        out.println("This is my first servlet.");
        out.println("</body>");
    }// end doGet                                                                                                      

}///:~

Does anybody have about what the error messsage says?

---------- Post updated 08-17-09 at 02:20 AM ---------- Previous update was 08-16-09 at 11:24 AM ----------

Hello Freinds My Problem Solved thing is that I misused Jdk version instead of 1.6 I used 1.5 so the problem solved

Last edited by srinivas2828; 08-16-2009 at 12:29 PM.. Reason: spelling mistakes
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Web Development

HTTP Headers Reference: HTTP Status-Codes

Hypertext Transfer Protocol -- HTTP/1.1 for Reference - HTTP Headers 10 Status Code Definitions Each Status-Code is described below, including a description of which method(s) it can follow and any metainformation required in the response. (1 Reply)
Discussion started by: Neo
1 Replies

2. Solaris

Tomcat..Unable to deploy application remotely in tomcat

Hi, We have upgrade tomcat from 5.0.20 to 7.0.33 and made changes to server.xml file according to newer version.. how ever the upgrade went fine and now i am unable to deploy application remotely.. it is giving 403 access denied error.. we have seperate appbase directory mentioned in server.xml..... (0 Replies)
Discussion started by: phani4u
0 Replies

3. UNIX for Dummies Questions & Answers

302 server status code to 301/404 server status code

Hello, Sorry for my english. I have an arcade site. mydomain.com/game.html If database has the game name is good. mydomain.com/fd43f54.html if database has not the game name redirect to mydomain.com by 302 error code. if database has not the game name i want a 301/404 error code and no... (0 Replies)
Discussion started by: hoo
0 Replies

4. Shell Programming and Scripting

Fill the values between -500 to 500 -awk

input -200 2.4 0 2.6 30 2.8 output -500 0 -499 0 -488 0 .......... .......... .... -200 2.4 .... ... 0 2.6 (6 Replies)
Discussion started by: quincyjones
6 Replies

5. Solaris

Not able to connect (ping & http) to windows 2003 (with IIS installed) from Solaris9 Machine(Tomcat)

hi Am trying to connect from Solaris 9 installed Sun server and having Tomcat 5.5.9 installed on top of it to Windows 2003 server with IIS installed for web application. Scenarios am facing are 1. From Sun system am able to ping and telnet ip with port 80 of windows 2000 system which is... (2 Replies)
Discussion started by: aemunathan
2 Replies

6. Solaris

what is the difference between http & Tomcat web server

I do not know the difference between the apache-http and the apche-Tomcat.Is they are differentiated on their version or on their features.:confused: (2 Replies)
Discussion started by: jayaprakash
2 Replies

7. Windows & DOS: Issues & Discussions

HTTP Status 500

Hello all, sori my english very bad,but 1 month i search about this case and nothing can help,maybe I wrong place but please if anybody can help me about this error: java.lang.ArrayIndexOutOfBoundsException: 0 >= 0 at java.util.Vector.elementAt(Vector.java:432) at... (2 Replies)
Discussion started by: fredginting
2 Replies

8. Red Hat

Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58

I have successfully installed RedHat 8.0 onto a Dell PowerEdge SC1425 today. This server has two SATA hard drives, and an IDE DVD-ROM drive. Using the following kernel parameters, i successfully installed across both hard drives from CD: ide0=0x1f0,0x3f6,14 vga=791 resolution=1024x768 expert... (5 Replies)
Discussion started by: fishsponge
5 Replies

9. IP Networking

http error code

Hi, I'm looking for detailed http error codes. I want to know what means : HTTP/1.1" 302 330 and HTTP/1.1" 302 265 Many thanks. (1 Reply)
Discussion started by: big123456
1 Replies
Login or Register to Ask a Question