Hi All, This is quite a desperate cry, i've been trying to solve this problem now for over a day and a half, I've seen lots of other threads on google with the same issues and have have tried each solution I found but to no avail.
I cannot connect to my database using JNDI., the actual error is "DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
JDBC driver of class '' for connect URL 'null'"
Quick Outline ; I tend to develop in netbeans 4, and then move the build over to another installation of
tomcat for final
testing before putting it on a live external server. The system works ok through netbeans
IDE, but the tomcat 5.5.7 installation is not playing. I believe I ahve installed all the correct jar's for DBCP and Connector/J. In my common/lib folder there are the commons' jar's and also the mysql-connector-java-3.1.7-bin.jar file.
the MySql connector is also there in the web-inf/lib directory. I also have the jar listed in the classpath environment variable, so I cant see any problem in tomcat detecting the driver.
My Web.xml contains.....
<resource-ref>
<description>
Resource reference to a factory for java.sql.Connection
instances that may be used for talking to a particular
database that is configured in the server.xml file.
</description>
<res-ref-name>
jdbc/ez2000
</res-ref-name>
<res-type>
javax.sql.DataSource
</res-type>
<res-auth>
Container
</res-auth>
</resource-ref>
and the server.xml contains ...
<Resource
name="jdbc/ez2000"
type="javax.sql.DataSource"
password="ferret"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
username="root"
url="jdbc:mysql://localhost/ez2000"
maxActive="4"/>
within the GlobalNamingResources tag.
What else.. hmm the
JSP which i'm using to test is very simple, I include the JSTL tag and am testing the connection with the line
<sql:query var="queryresults" dataSource="jdbc/ez2000">SELECT * from keys</sql:query>
I can connected directly to the database using the netbeans IDE database explorer. so that proves url i'm is correct. And when I log into the tomcat admin screen, the database section lists my jdbc/ez2000 connection which says to me server.xml entries are correct.
If anyone can help, has any advice its greatly appreciated.
Thanks.
[Bear edit: better subject]
[ March 17, 2005: Message edited by: Bear Bibeault ]