java: Cannot load JDBC driver class 'com.microsoft.jdbc.sqlserver.SQLServerDriver'

蔡晨
2023-12-01

驱动程序已拷贝到类路径目录下,还出现找不到指定类,后来将“jakarta-tomcat-5.0.28”换为“jboss-4.0.2”即可

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.microsoft.jdbc.sqlserver.SQLServerDriver'
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.microsoft.jdbc.sqlserver.SQLServerDriver'
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:766)
 at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
 at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:107)
 at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
 at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:440)
 at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:506)
 at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:545)
 at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:563)
 at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:573)
 at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:593)
 at com.rongji.rjchat.dao.UserDAOImpl.getUsers(UserDAOImpl.java:31)
 at com.rongji.rjchat.struts.action.SendMessageAction.execute(SendMessageAction.java:42)
 at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at com.rongji.rjchat.struts.ActionServlet.process(ActionServlet.java:24)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
 at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
 at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
 at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
 at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:854)
 at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:164)
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:760)
 ... 43 more
 

 类似资料:

相关阅读

相关文章

相关问答