Olá !
Na minha aplicação, uma página faces chama um servlet via Ajax ( XMLHttpRequest ) . Quando eu coloco um comando de busca no banco de dados, dá o seguinte erro :
Error Loading Pagen500:Internal Server Error
.
O que significa ? Onde errei ? Sem o acesso ao banco, tudo funciona bem.
Meu Servlet
[code]public class Resposta extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
//UserOp userOp=new UserOp();//business layer class.
//implementation not shown for brevity
//get the userId
String targetId = request.getParameter("codigoEmpresa");
//check the id. If it is not existing already then return true else false
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
try {
BdPrestador bd = new BdPrestador();
// ERRO NA LINHA ABAIXO
DTOPrestador umPrestador = bd.buscaPeloCodigo("100013");
response.getWriter().write("<nomeDivulgacao>"+umPrestador.getNomeDivulgacao()+"</nomeDivulgacao>");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
[/code]
Obrigado,
Márcio
[SOLUÇÃO]
Era um jar que não estava no projeto. :oops:
Valeu !