java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver

后端 未结 5 1209
广开言路
广开言路 2021-01-13 00:39
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver

I got the above exception when i trying to deploying my Application

相关标签:
5条回答
  • 2021-01-13 01:08

    Eventhough you have JAR(sqlserverjdbc.jar) in build path You need to add the jar file containing the class. com.microsoft.sqlserver.jdbc.SQLServerDriver to your war file's WEB-INF/lib folder.

    0 讨论(0)
  • 2021-01-13 01:17

    May 15, 2014 3:09:43 PM org.apache.tomcat.jdbc.pool.ConnectionPool init SEVERE: Unable to create initial connections of pool. java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254) at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182) at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635) ...

    It is quite puzzling because my web application has WEB-INF/lib/sqljdbc4.jar.

    From the error message, somehow the jar file is required by Tomcat too.

    After I copy the jar file to CATALINA_HOME/lib/sqljdbc4.jar, the error is gone.

    0 讨论(0)
  • 2021-01-13 01:18

    Since you're running a web app, you need to have the MS SQL Server driver--or the driver for any DB--stored in two places. Inside the app that becomes your WAR and then you need a second copy that is stored in the App Server's LIB directory. So, if you're running on Tomcat then you would put it /opt/tomcat/lib or C:\DEV\tomcat7\lib.

    0 讨论(0)
  • 2021-01-13 01:31

    You need to add the jar file containing the class com.microsoft.sqlserver.jdbc.SQLServerDriver to your war file's WEB-INF/lib folder.

    0 讨论(0)
  • 2021-01-13 01:31

    Read Tomcat Documentation about classpath for clarification or just put the sqljdbc.jar in $CATALINA_HOME/lib to access it from all your applications.

    0 讨论(0)
提交回复
热议问题