----- Original Message -----
From: David Smith
Sent: 03/09/08 01:49 am
To: Tomcat Users List
Subject: Re: Can't execute servlet project
DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException:
Cannot create JDBC driver of class '' for connect URL 'null'"
This error typically indicates the JNDI db pool hasn't been setup
correctly. Some config option isn't setup. What's in this webapp's
context xml file? Also what's in it's WEB-INF/web.xml? Lastly, you
should have your database driver jar file in tomcat's common/lib (for
tomcat v 5.5) or /lib (tomcat v 6).
You can also take a look at tomcat's JDBC Datasource howto's on the
tomcat website for your version of tomcat which offer a lot of help.
--David
sam wun wrote:
Thanks David,
After copied the jstl and standard dot jar files into the directory:
linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF/lib # ls
. .. jstl.jar mysql-connector-java-5.1.3-rc-bin.jar standard.jar
I got the following different errors:
(In line 4, what is jdbc/TestDB? I have database called javatest, and
table
testdata. Should I rename it to jdbc/javatest?
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented
it
from fulfilling this request.
exception org.apache.jasper.JasperException: Exception in JSP:
/testdb.jsp:4
1: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
2: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
3:
4: <sql:query var="rs" dataSource="jdbc/TestDB">
5: select id, foo, bar from testdata
6: </sql:query>
7:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause javax.servlet.ServletException: Unable to get connection,
DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException:
Cannot
create JDBC driver of class '' for connect URL 'null'"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause javax.servlet.jsp.JspException: Unable to get connection,
DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException:
Cannot
create JDBC driver of class '' for connect URL 'null'"
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276)
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159)
org.apache.jsp.testdb_jsp._jspx_meth_sql_005fquery_005f0(testdb_jsp.java:101)
org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)