Pessoal, estou começando a desenvolver uma aplicação para web agora, estou usando JEE5 e GlassFish 2.1, estava tudo rodando, até eu criar um servlet, depois disso, começou a aparecer esse erro:
[b]HTTP Status 503 -
type Status report
message
descriptionThe requested service () is not currently available.[/b]
Nao sei onde está o erro, nao sei se eh alguma exceção no meu servlet novo.
O servlet que eu fiz, e coloquei dentro do modulo WAR, esta assim:
[quote]
package servlets;
import entidades.Funcionario;
import facades.FuncionarioFacadeRemote;
import java.io.IOException;
import java.io.PrintWriter;
import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class FuncionarioServlet extends HttpServlet {
@EJB
private FuncionarioFacadeRemote manager;
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try
{
String nome = "Teste"; //VARCHAR(60) NOT NULL
String endereco = "Teste"; //VARCHAR(60)
String numero = "123"; //VARCHAR(10)
String complemento = "casa"; //VARCHAR(30)
String bairro ="centro"; //VARCHAR(20)
String cidade ="Friburgo"; //VARCHAR(40)
int ufCodigo = 19; //INTEGER NOT NULL
String cep = "28600000"; //VARCHAR(9)
int dddTel1 = 22; //INTEGER
int telefone1 = 25230975; //INTEGER
int dddTel2 = 0; //INTEGER
int telefone2 = 0; //INTEGER
int dddCel1 = 22; //INTEGER
int celular1 = 92039785; //INTEGER
int dddCel2 = 0; //INTEGER
int celular2 = 0; //INTEGER
String email1 ="[email removido]"; //VARCHAR(30)
String email2 = null; //VARCHAR(30)
String lattes = null; //VARCHAR(30)
int siape = 1657922; //INTEGER
int cargoCodigo = 11; //INTEGER NOT NULL
int funcaoCodigo = 1; //INTEGER NOT NULL
int setorCodigo = 1; //INTEGER NOT NULL
int tipoFuncionarioCodigo = 1;//INTEGER NOT NULL
int instituicaoCodigo = 1; //INTEGER NOT NULL
//int foto_codigo; //INTEGER NOT NULL
String obs = null; //VARCHAR
Funcionario funcionario = new Funcionario(
nome,
endereco,
numero,
complemento,
bairro,
cidade,
cep,
dddTel1,
telefone1,
dddTel2,
telefone2,
dddCel1,
celular1,
dddCel2,
celular2,
email1,
email2,
lattes,
siape,
obs
);
manager.create(funcionario);
}
finally
{
out.close();
}
}
// <editor-fold defaultstate="collapsed" desc="Métodos HttpServlet. Clique no sinal de + à esquerda para editar o código.">
/**
* Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}