Bom dia pessoal.
Estou com um problema gigante, preciso fazer um deploy de atualizaçao do meu sistema, mas quando vou upar ele, ocorre esse erro aqui:
Original:
Uso JSF 2.0 e Glassfish 3.1.2.2
Essa é a minha classe validaTipoTela
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package MBs;
import Conexao.Conexao;
import java.io.IOException;
import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import org.primefaces.component.menuitem.MenuItem;
import org.primefaces.component.submenu.Submenu;
import org.primefaces.model.DefaultMenuModel;
import org.primefaces.model.MenuModel;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.servlet.http.HttpServletResponse;
import Funcoes.Funcoes;
/**
*
* @author COTRESC
*/
@ManagedBean
@SessionScoped
public class validaTipoTela implements Serializable {
private String tela = "home.xhtml";
private String tituloChamado = "";
private MenuModel model;
private static ResultSet rs;
private Integer idCodigoTipoChamado = 0;
private String emailLogado;
private String observacao = "";
private boolean mostraObs = false;
private Integer continiuarVerificando = 0;
private String link_redirecionamento = "";
public Integer getContiniuarVerificando() {
return continiuarVerificando;
}
public String getLink_redirecionamento() {
return link_redirecionamento;
}
public void setLink_redirecionamento(String link_redirecionamento) {
this.link_redirecionamento = link_redirecionamento;
}
public void setContiniuarVerificando(Integer continiuarVerificando) {
this.continiuarVerificando = continiuarVerificando;
}
public boolean isMostraObs() {
return mostraObs;
}
public void setMostraObs(boolean mostraObs) {
this.mostraObs = mostraObs;
}
public String getObservacao() {
return observacao;
}
public void setObservacao(String observacao) {
this.observacao = observacao;
}
public String getTela() {
return tela;
}
public void setTela(String tela) {
this.tela = tela;
}
public String getTituloChamado() {
return tituloChamado;
}
public void setTituloChamado(String tituloChamado) {
this.tituloChamado = tituloChamado;
}
public Integer getIdCodigoTipoChamado() {
return idCodigoTipoChamado;
}
public void setIdCodigoTipoChamado(Integer idCodigoTipoChamado) {
this.idCodigoTipoChamado = idCodigoTipoChamado;
}
public String getEmailLogado() {
return emailLogado;
}
public void setEmailLogado(String emailLogado) {
this.emailLogado = emailLogado;
}
public void tipoTela(Integer _tipo, Integer _idUsuario, Integer _idSetor) {
tela = "";
if (emailLogado.equals("Sem e-mail")) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "Impossível Abertura de Chamado:", "Usuário e Supervisor sem e-mail cadastrado. Verifique!"));
tela = "enviaEmailUsuario.xhtml";
} else {
try {
rs = Conexao.Consulta("select htc.id, hm.url, htc.descricao, hm.observacao "
+ "from help_menu hm "
+ "left join help_tipos_chamados htc on htc.id = hm.id_tipos_chamados "
+ "where hm.id = " + _tipo.toString());
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao Carregar Menu - Tela", ex.getMessage()));
return;
}
try {
rs.next();
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao Carregar Menu - Tela - Next", ex.getMessage()));
return;
}
try {
observacao = rs.getString("observacao");
tela = rs.getString("url");
tituloChamado = rs.getString("descricao");
idCodigoTipoChamado = rs.getInt("id");
if (observacao == null) {
mostraObs = false;
} else {
mostraObs = true;
}
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao Passar Tipo tela para Chamada", ex.getMessage()));
return;
}
try {
if (rs.getInt("id") > 0) {
try {
rs = Conexao.Consulta("select count(*) as qtd "
+ "from help_abertura_chamado "
+ "where id_usuario = " + _idUsuario.toString()
+ " and status = 'F' and (status_retorno_usuario = 'R' or status_retorno_usuario is null) "
+ "and id_setor = " + _idSetor.toString());
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao Carregar Menu - Tela - Erro qtd", ex.getMessage()));
return;
}
try {
while (rs.next()) {
if (rs.getInt("qtd") > 0) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "Impossível Abertura de Chamado:", "Você possuí um chamado pendente para finalização. Verifique!"));
tela = "meusChamadosUsuario.xhtml";
}
}
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao Carregar Menu - Tela - While Impossivel Abrir chamados", ex.getMessage()));
}
}
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao Carregar Menu - Tela - If id > 0", ex.getMessage()));
}
}
telaChamada();
}
public String telaChamada() {
Funcoes funcao = new Funcoes();
link_redirecionamento = funcao.linkRedirectSistema();
return tela;
}
public MenuModel MenuBean(String _perfilUsuario, String _email, Integer _idUsuario, Integer _idSetor) {
try {
emailLogado = _email;
/*String sSQL = "select hm.id, case when htc.descricao is null then hm.descricao else htc.descricao end as desc_menu, hm.tipo, hm.url, hm.icone "
+ "from help_menu hm "
+ "left join help_tipos_chamados htc on htc.id = hm.id_tipos_chamados "
+ "where case when '" + _perfilUsuario.toString() + "' = 'Usuário' then hm.tipo_menu in ('U','T') else hm.tipo_menu in ('A','T') end "
+ "and case when hm.id_setor = " + _idSetor.toString()
+ "order by hm.ordem";
*/
String sSQL = "select hm.id, case when htc.descricao is null then hm.descricao else htc.descricao end as desc_menu, hm.tipo, hm.url, hm.icone, hm.ordem "
+ "from help_menu hm "
+ "left join help_tipos_chamados htc on htc.id = hm.id_tipos_chamados "
+ "where case when '" + _perfilUsuario.toString() + "' = 'Usuário' then hm.tipo_menu in ('U','T') else hm.tipo_menu in ('A','T') end "
+ "and hm.id_setor is null "
+ "union all "
+ "select hm.id, case when htc.descricao is null then hm.descricao else htc.descricao end as desc_menu, hm.tipo, hm.url, hm.icone, hm.ordem "
+ "from help_menu hm "
+ "left join help_tipos_chamados htc on htc.id = hm.id_tipos_chamados "
+ "where case when '" + _perfilUsuario.toString() + "' = 'Usuário' then hm.tipo_menu in ('U','T') else hm.tipo_menu in ('A','T') end "
+ "and hm.id_setor = " + _idSetor.toString()
+ "order by ordem ";
rs = Conexao.Consulta(sSQL);
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao Carregar Menu", ex.getMessage()));
return null;
}
FacesContext fctx = FacesContext.getCurrentInstance();
ELContext elctx = fctx.getELContext();
Application app = fctx.getApplication();
ExpressionFactory exprFactory = app.getExpressionFactory();
Submenu submenu = null;
model = new DefaultMenuModel();
boolean add;
try {
while (rs.next()) {
if (rs.getInt("tipo") == 0) {
submenu = new Submenu();
submenu.setLabel(rs.getString("desc_menu"));
model.addSubmenu(submenu);
} else if (rs.getInt("tipo") == 1) {
MenuItem item = new MenuItem();
item.setValue(rs.getString("desc_menu"));
if (!rs.getString("url").substring(0, 3).equals("ftp")) {
item.setActionExpression(exprFactory.createMethodExpression(elctx,
"#{validaTipoTela.tipoTela(" + rs.getString("id") + "," + _idUsuario.toString() + "," + _idSetor.toString() + ")}", String.class,
new Class<?>[0]));
} else {
item.setUrl(rs.getString("url"));
item.setTarget("_blank");
}
item.setId("im" + rs.getString("id"));
item.setAjax(false);
item.setIcon(rs.getString("icone"));
item.setUpdate("fdiv");
add = submenu.getChildren().add(item);
if (add) {
model.addSubmenu(submenu);
}
}
}
} catch (SQLException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "Erro ao Carregar Menu - Next", ex.getMessage()));
}
return model;
}
public String actionMenu() {
return "chamados.xhtml";
}
public MenuModel getModel() throws SQLException {
return model;
}
public void trocaSetor() throws IOException {
tela = "home.xhtml";
HttpServletResponse response = null;
response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.sendRedirect(link_redirecionamento + "telaSelecionaSetores.xhtml");
}
public void telaHome() throws IOException {
tela = "home.xhtml";
HttpServletResponse response = null;
response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.sendRedirect(link_redirecionamento + "chamados.xhtml");
}
public String continuaBrowserDesatualizado() {
this.continiuarVerificando = 1;
this.tela = "home.xhtml";
HttpServletResponse response = null;
response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
try {
response.sendRedirect(link_redirecionamento + "chamados.xhtml");
} catch (IOException ex) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Erro ao carregar tela - Verificar de Navegador", ex.getMessage()));
}
return "chamados";
}
}
Se alguém puder me dar uma força nessa manha de domingo, pois nao faço ideia o que pode ser isso e agora o meu sistema está parado!!!
Obrigado