Error: Cannot create JDBC driver of class '' for connect URL 'null', cause: No suitable driver
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   scott_blickhan
Posted On:   Friday, April 30, 2004 01:21 PM

I cannot seem to get the JNDI lookup to work with Tomcat 5 and MySql. I have attached the web.xml and server.xml files. I have placed the mysql-connector-java-3.0.11-stable-bin.jar in the catalina/common/lib directory. ***********server.xml********** factory org.apache.commons.dbcp.BasicDataSourceFactory username name password secret driverClassName com.jdbc.mysql.Driver url jdbc:mysql://localhost:3306/licenses?autoReconnect=true ************web.xml************* SCCM License Application SCCM License Application.    More>>

I cannot seem to get the JNDI lookup to work with Tomcat 5 and MySql. I have attached the web.xml and server.xml files. I have placed the mysql-connector-java-3.0.11-stable-bin.jar in the catalina/common/lib directory.

			
***********server.xml**********











factory
org.apache.commons.dbcp.BasicDataSourceFactory


username
name


password
secret


driverClassName
com.jdbc.mysql.Driver


url
jdbc:mysql://localhost:3306/licenses?autoReconnect=true





************web.xml*************

SCCM License Application
SCCM License Application.

SCCM_frame.monkeymojo
/sccm/jsp/SCCM_frame.jsp



SCCM_frame.monkeymojo
/license/SCCM_frame.monkeymojo

Sccm License App

Sccm DB Connection
jdbc/license
javax.sql.DataSource
Container



   <<Less

Re: Error: Cannot create JDBC driver of class '' for connect URL 'null', cause: No suitable driver

Posted By:   Alexey_Chervyakov  
Posted On:   Monday, July 12, 2004 03:27 AM


There is a new ugly feature in Tomcat 5.xx :( When your web-application have been deployed, Resource reference created for each context, but this referrence have an empty value of URL and DriverClass name.





You have to describe an additional reference to Resource for each HOST and context.
You can use Tomcat admin interface and repeat resource description from general section (Resources->Data Sources) in context related Tomcat (Server->Service->Host(yourhost)->Context(/sccm)->Resources->Data Sources). But you will have to repeat it after every deployment :(
Another way is creation an additional web.xml file in folder "Tomcat 5.xxconfCatalinayourhostweb.xml" with description of resource for your context like follow:











urljdbc:mysql://localhost:3306/licenses?autoReconnect=true

driverClassNamecom.jdbc.mysql.Driver





About | Sitemap | Contact