首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

请教这个org.apache.tomcat.dbcp.dbcp.SQLNestedException:Cannot create JDBC driver of

2012-01-20 
请问这个org.apache.tomcat.dbcp.dbcp.SQLNestedException:Cannot create JDBC driver oforg.apache.tomca

请问这个org.apache.tomcat.dbcp.dbcp.SQLNestedException:Cannot create JDBC driver of
org.apache.tomcat.dbcp.dbcp.SQLNestedException:Cannot create JDBC driver of class 'com.microsoft.sqlserver.jdbc.SQLServerDataSource' for connect URL 'jdbc:sqlserver://WANGCONG-PC:1433;DatabaseName=restrant'

at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.cdjj.wangcong.jj2.bean.DBConnection.getCon(DBConnection.java:25)
at com.cdjj.wangcong.jj2.dao.TextQuery.find(TextQuery.java:24)
at org.apache.jsp.ch06.textQuery_jsp._jspService(textQuery_jsp.java:60)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:264)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
... 22 more
2010-4-7 22:56:58 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at com.cdjj.wangcong.jj2.bean.SQLCommandBean.executeQuery(SQLCommandBean.java:53)
at com.cdjj.wangcong.jj2.dao.TextQuery.find(TextQuery.java:32)
at org.apache.jsp.ch06.textQuery_jsp._jspService(textQuery_jsp.java:60)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)


at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

这个错误应该怎么解决.contex 配置是:

<Resource name="jdbc/restrant" auth="Container" type="javax.sql.DataSource" maxActive="100"maxIdle="30" maxWait="10000" username="sa"password="wangcong"  

driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDataSource"
  url="jdbc:sqlserver://WANGCONG-PC:1433;DatabaseName=restrant"/>

数据库是sqlserver2005.tomcat6.0


[解决办法]
应该是加载不了Sqlserver的驱动吧,将Sqlserver包引入试下。

热点排行