에 대한 적절한 드라이버가 없습니다.이 문제로 인해 끔찍한 문제가 발생했습니다. 한 달 이상 프로젝트를 폐기했습니다.Tomcat 오류 : java.sql.SQLException : jdbc : sqlserver : //
java.sql.SQLException의 : JDBC에 대한 찾을 수 없습니다 적합 드라이버 ... 그러나 나는 아직도
은 그래서 내게이 오류를 던지고 ... 그것을 해결하고 프로젝트를 계속해야합니다 : sqlserver : //isd.ktu.lt : 1433; DatabaseName = LN2012_bakDB2 java.lang.NullPointerException문제는 동일한 응용 프로그램이 deskto에서 작동한다는 것입니다. p version perfectlz하지만, 서버 (NetBeans 7.1.2의 Tomcat 7.0.22.0)에서 실행될 것으로 예상되는 버전의 경우 오류가 발생합니다. 그것은 여기 음 ... 그것은 풀링 드라이버를로드하지 못하거나 내가 알지도 못하는
을 보인다 책임이있는 부분 :
public DatabaseConnection(Parameters params) {
// parameters and the output
this.gui = params.getGui();
// activate database pool
connectionPool = new GenericObjectPool(null);
connectionFactory = new DriverManagerConnectionFactory(params.getDbAdr(), params.getDbUser(), params.getDbPass());
poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory, connectionPool, null, null, false, true);
driver = new PoolingDriver();
driver.registerPool("GenTreeDatabase", connectionPool);
//driver.registerPool("jdbc:apache:commons:dbcp:GenTreeDatabase", connectionPool);
}
public void openConn() {
if (allowOutput) gui.print("Getting connection to database");
try {
con = DriverManager.getConnection("jdbc:apache:commons:dbcp:GenTreeDatabase");
if (con != null) {
if (allowOutput) gui.print("Connection to database was successful");
}
} catch (SQLException ex) {
gui.err(specificError + "Error getting connection to database - " + ex);
}
}
그것은 그것이를 얻기 위해 시도하는 시점에서 발생 연결이 성공적으로 검색되지 않기 때문에 널 포인터 예외가 발생합니다.
나는이 순간까지 Tomcat에 익숙하지 않다. Netbeans는 바람둥이를 잘 처리했다. ... 물건은 내가 이런 오류를 싫어한다. 너는 3 일 만에 그것을 풀지 않으면 너는 그렇게된다. 좌절하고 그걸로 돌아가고 싶지 않다면, 벽을 치는 것 같은 기분이 들지 ... 나는 그것에 대해 많은 검색을 시도했지만 여전히 많은 도움이되지 못했습니다 ... 그래서 저는 정말로 다행이 누군가 나를 도와 줄 수 있다면. 감사. :)
스택 트레이스를 표시하십시오! – home
Tomcat 디렉토리에 데이터베이스 드라이버 (예 : sqljdbc4.jar)가 있습니까? –
@MartinWilson 그것은 C : \ Program Files \ Apache Software Foundation \ Apache Tomcat 7.0.22 \ lib –