Dá-lhe, galera do GUJ!!!
Seguinte, estou com um problema com minha conexão com o PostgreSQL, usando ConnectionFactory…
Configurei um Pool de conexões no Glassfish para meu banco de dados e está pingando normalmente.
Criei um JNDI e está ativo…
Na minha classe de conexão fiz assim:
public static Connection getConnection() throws Exception {
try {
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/vendas");
return ds.getConnection();
}
catch(Exception e) {
throw new Exception(e.getMessage());
}
}
E quando chamo a página para mostrar os dados numa dataTable (JSF), aparece esse erro:
[color=darkred]HTTP Status 500 -
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.Exception: No object bound to name java:comp/env/jdbc/vendas
root cause
javax.el.ELException: java.lang.Exception: No object bound to name java:comp/env/jdbc/vendas
root cause
java.lang.Exception: No object bound to name java:comp/env/jdbc/vendas
note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1_02 logs.
Sun Java System Application Server 9.1_02[/color]
Alguém sabe me dizer o que seria isso???
Valeu…