Olá a todos,
Galera dá uma ajudinha aí.
estou tentando aprender um pouco de java ee, mas estou tendo o seguinte erro:
…
Type Exception Report
Message Servlet execution threw an exception
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
java.lang.Error: Unresolved compilation problem: Unhandled exception type ClassNotFoundException br.com.caleum.dao.ContatoDAO.<init>(ContatoDAO.java:22) br.com.caleum.servlet.AdicionandoContatoServlet.service(AdicionandoContatoServlet.java:50) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.
…
Está dizendo que o drive não jdbc não foi encontrado? mais eu adicionei o que tenho “\mysql-connector-java-5.1.41-bin.jar” e não tá funfando . tentei até adicionar o classforname
alias, meu metodo está assim:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class FabricaDeConexoes {
public Connection getConnetion() throws ClassNotFoundException {
Class.forName("com.mysql.jdbc.Driver");
try {
return DriverManager.getConnection("jdbc:mysql://localhost/fj21", "root", "");
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
}
se alguém poder dar uma ajuda. agredeço desde já