好吧,我的 Tomcat(通过 Eclipse 运行)似乎无法加载 SQL Server 驱动程序库:
java.lang.NullPointerException
java.lang.RuntimeException
at org.ktu.gdia.core.MainController.processFile(MainController.java:132)
at org.ktu.gdia.core.MainController.run(MainController.java:57)
java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://isd.ktu.lt:1433;DatabaseName=LN2012_bakDB2
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.tomcat.dbcp.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:75)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1185)
at org.apache.tomcat.dbcp.dbcp.PoolingDriver.connect(PoolingDriver.java:180)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.ktu.gdia.database.DbActions.openConn(DbActions.java:64)
at org.ktu.gdia.core.MainController.processFile(MainController.java:134)
at org.ktu.gdia.core.MainController.run(MainController.java:57)
Exception in thread "Thread-2" java.lang.NullPointerException
at org.ktu.gdia.database.GenForestDatabase.personExists(GenForestDatabase.java:178)
at org.ktu.gdia.core.MainController.processFile(MainController.java:158)
at org.ktu.gdia.core.MainController.run(MainController.java:57)
sqljdbc.jar 和 sqljdb4.jar 和 jtds-1.3.0.jar 位于 Tomcat/lib 目录中。我正在使用 Tomcat 7。Eclipse 是否有可能使 Tomcat 使用与它应该使用的 Tomcat 7 中不同的 lib 目录?