tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Pedersen" <john.peder...@gmail.com>
Subject configuration issue
Date Wed, 14 May 2008 17:05:25 GMT
Hi,

I have spent days and days chasing this error:

Cannot create JDBC driver of class '' for connect URL 'null'

I have now resolved the issue.

This was my configuration:

META-INF/context.xml:

<Context debug="3" reloadable="true">
   <Resource name="compatMYSQL" auth="Container" type="javax.sql.DataSource"
    factory="org.apache.commons.dbcp.BasicDataSourceFactory"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost/appName"
    username="user"
    password="pass"
    maxActive="10"
    maxIdle="5"
    validationQuery="SELECT 1"
    testOnBorrow="true"
    testWhileIdle="true"
    timeBetweenEvictionRunsMillis="10000"
    minEvictableIdleTimeMillis="60000"
    maxWait="5000"
    removeAbandoned="true"
    removeAbandonedTimeout="60"
    logAbandoned="true"
    noTimezoneConversionForTimeType="true"    />
</Context>


in web.xml:

<resource-ref>
		<res-ref-name>compatMYSQL</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>


This arrangement works on my local machine, but it throws the error on my
hosting server ( private JVM, Tomcat 6, on *nix *Virtual* Private *Server )

To fix it, I had to delete *META-INF/context.xml, and put the context info
in server.xml ( which the Tomcat documentation recommends NOT doing).

Why would my original config not work?

After spending so long resolving this, I am curious as to why it happened.

Any comments most welcome, thanks,

John Pedersen

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message