魔兽传奇

java程序爱好者
posts - 28, comments - 16, trackbacks - 0, articles - 6
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Tomcat配置数据源错误

Posted on 2008-03-14 14:12 龙旋风 阅读(550) 评论(2)  编辑  收藏
求助?我配完tomcat数据源,在comm/lib中加了驱动程序,web.xml中也加了相应的<resource-ref>,但是测试数据源是否成功时出现下面的错误

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
 at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
 at org.apache.jsp.DB.test_jsp._jspService(test_jsp.java:60)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
 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.sql.SQLException: No suitable driver
 at java.sql.DriverManager.getDriver(DriverManager.java:243)
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
 ... 32 more

评论

# re: Tomcat配置数据源错误  回复  更多评论   

2008-03-14 20:22 by 和风细雨
http://www.blogjava.net/junglesong/archive/2008/02/22/181244.html

# re: Tomcat配置数据源错误  回复  更多评论   

2008-04-02 12:43 by jackiesmith
我已经解决了Tomcat中配置数据源的问题,并且通过jsp页面验证数据源已经获得。但是在web项目中新建一个java类却无法获得数据源,为什么??

只有注册用户登录后才能发表评论。


网站导航: