Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

SOLUTION!! -- Cannot load JDBC driver class 'null'

SANTOS, DANIEL (SBCSI)

2003-09-19


Using Sun JDK 1.4.1_02 on Win2k SP2 and Jakarta 4.1.27.

The tutorial in the tomcat docs failed for me also with the Cannot load JDBC
driver class 'null'. I banged my head and had to get stitches and an ice
pack. After that I came back to the office and cleaned out my server.xml and
web.xml completely. Then I went to http://localhost:8080/admin
<http://localhost:8080/admin> , browsed to the context that I am writing my
app in, the full path from the tree being "Tomcat Server/Service
(Tomcat-Standalone)/Host (localhost)/Context(/myapp)/Resources/Data
Sources". I added the data source from there specifying the JNDI name,
driver class, URL, user and pass, etc. Then I did some tests with a jsp to
make sure it was really in my context (you may have to restart tomcat, I
did).

Next I added the code back into my web.xml that is in the tutorial....

 <resource-ref>
   <description>DB Connection</description>
   <res-ref-name>myData Source</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
 </resource-ref>

And it works!!! I just have a new problem now of DBCP borrowObject failed:
String index out of range: -1, I suppose I'll figure that out too...

Good Luck and thanks to all who posted info on this,
Daniel



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.