Erro ao tentar rodar Servlet

Pessoal, alguem pode me ajudar qdo vou rodar um servlet de teste tenho o seguinte erro:
Erro 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:151)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
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:685)
java.lang.Thread.run(Unknown Source)

root cause

java.lang.UnsupportedClassVersionError: Bad version number in .class file
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:873)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1326)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
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:685)
java.lang.Thread.run(Unknown Source)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.

Ja fiz de tudo configurei minhas variaveis, recompilei, instalei o j2sdk eo tomcat novamente mas nao funciona…

posta seu codigo … fica melhor p/ a resolucao ou nao …

uma pergunta: vc importou o httpServlet … ???

exemplo:

[code]import fontes.SUA_CLASSE;
import java.io.;
import java.net.
;

import javax.servlet.;
import javax.servlet.http.
;

public class NOME_SERVLET extends HttpServlet {

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");




[/code]

Abs.

Ai vai meu codigo, retirei ele de um artigo.

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

 public class HelloServlet extends HttpServlet{
     public void doGet(HttpServletRequest request, HttpServletResponse response)
     throws IOException, ServletException {


    response.setContentType("text/html");

     // pegamos o PrintWriter do response, através 
     // do qual escreveremos o conteudo da pagina
     PrintWriter out = response.getWriter();

     // Agora vamos escrever o conteudo da pagina
     out.println("<HTML>");
     out.println("<BODY>");
     out.println("<H1>Hello World!</h1>");
     out.println("</body>");
     out.println("</html>");

}
}

Declarasse no web.xml o servlet mapping?

cara, copiei e colei seu codigo no netbeans (IDE q eu uso) e funcionou perfeito!

verifica sua JDK…
ve as variaveis de ambiente tbm se estao certos…

Tente isso tbm:

[quote]marcosbrandao: Declarasse no web.xml o servlet mapping?
[/quote]

Abs.

O meu web.xml esta assim:

<?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>

&lt;!-- Indica ao Tomcat as Servlets da nossa aplicacao --&gt; 
 
&lt;servlet&gt; 
    &lt;servlet-name&gt;HelloServlet&lt;/servlet-name&gt; 
    &lt;servlet-class&gt;HelloServlet&lt;/servlet-class&gt; 
&lt;/servlet&gt; 

&lt;!-- Define um padrão de url através do qual a HelloServlet será acessada. 
 No caso qualquer url do tipo 
 "http://localhost:8080/HelloServletApp/QualquerCoisa.teste" 
 faz com que a nossa HelloServlet seja chamada --&gt; 
 
&lt;servlet-mapping&gt; 
    &lt;servlet-name&gt;HelloServlet&lt;/servlet-name&gt; 
    &lt;url-pattern&gt;*.teste&lt;/url-pattern&gt; 
&lt;/servlet-mapping&gt; 
 
&lt;!-- Define outro padrão de url através do qual a HelloServlet será acessada. 
 No caso, a url "http://localhost:8080/HelloServletApp/HelloServlet" 
 faz com que a nossa HelloServlet seja chamada --&gt; 
 
&lt;servlet-mapping&gt; 
    &lt;servlet-name&gt;HelloServlet&lt;/servlet-name&gt; 
    &lt;url-pattern&gt;/HelloServlet&lt;/url-pattern&gt; 
&lt;/servlet-mapping&gt; 

&lt;session-config&gt; 
    &lt;session-timeout&gt;30&lt;/session-timeout&gt; &lt;!-- 30 minutes --&gt; 
&lt;/session-config&gt; 

</web-app>

ja cnfigurei minhas variaves conforme um tutorial da web:

catalina_home = C:\arquiv~1\apache~1\tomcat~1
classpath = .;JAVA_HOME;%CATALINA_HOME%\common\lib\servlet-api.jar;.;%CLASSPATH%
path = C:\Arquiv~1\java\jdk1.5.0_11\bin
java_home = C:\arquiv~1\java\jdk1.5.0_11\bin