Erro Apache (HTTP Status 500)

1 resposta
C

Olá galera!
Preciso de ajuda!

Estou usando Netbeans com Apache e está acontecendo o seguinte:

Criei uma JSP com o nome Listagem.jsp com o código abaixo:

<%@page contentType=“text/html”%>
<%@page pageEncoding=“UTF-8”%>
<%@
include file=“ServerConfiguration.jsp”
%>
<%@
page import=“org.firebirdsql.jdbc.,org.firebirdsql.logging.Logger,java.sql.
%>
<%
Class.forName(“org.firebirdsql.jdbc.FBDriver”);
Connection aConnection = DriverManager.getConnection( DataBaseAddr,
UserName, Password);
Statement stmt = aConnection.createStatement();
String SQL=“SELECT * TB_USUARIO “;
SQL=SQL+ “ORDER BY NOMEUSUARIO”;
ResultSet aQuery = stmt.executeQuery(SQL);
%>
<html>
<body bgcolor=”#E0E0E0”>
<table>
<tr><td>“ID USUARIO”</td><td>“LOGIN DO USUARIO”</td><td>“NOME DO USUARIO”</td></tr>
<%
while (aQuery.next())
{
%>
<tr>
<td><%= aQuery.getString(“IDUSUARIO”) %></td>
<td><%= aQuery.getString(“LOGIN”) %></td>
<td><%= aQuery.getString(“NOMEUSUARIO”) %></td>
</tr>
<%
}
%>
</table>
<%
aQuery.close();
stmt.close();
aConnection.close();
%>
</body>
</html>

Compila certinho e não dá nem um errinho

Mas, quando tento exibir no Brawse aparece no brewse o seguinte erro:

HTTP Status 500 -


type Status report

message

description The server encountered an internal error () that prevented it from fulfilling this request.


Apache Tomcat/6.0.13

1 Resposta

C

Olá claudiolcm

De início acho uma péssima prática o uso de SQL, ResultSet, Statements etc dentro dos JSP’s, tendo em vista que o mais aconselhado é colocar estes códigos em uma classe de conexão por exemplo.

Mas olhando o código, o que a página “ServerConfiguration.jsp” está fazendo?? O erro pode ser dela.
Outra coisa o IDUSUARIO é uma String??
Verifique o arquivo web.xml e veja se o mesmo está correto, pois se existirem tag’s abertas, listener declarados sem que os mesmos existam pode ocasionar o erro e, neste caso a aplicação não starta

Criado 21 de junho de 2007
Ultima resposta 25 de jun. de 2007
Respostas 1
Participantes 2