tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geralyn M Hollerman <>
Subject Re: Problem confinguring MySQL JNDI Datasource RH Linux 7.2
Date Thu, 31 Jul 2003 18:23:36 GMT wrote:

> I have followed instructions provided for configuring JNDI Datasource for MySQL (,
and am running into problem on RedHat Linux 7.2.
> Here is my configuration:
> RedHat Linux 7.2 (kernel-2.4.7-10)
> Tomcat 4.1.24 (Clean install)
> MySQL 4.0.12
> Using mysql-connector-java-3.0.8-stable-bin.jar (driver installed in $CATALINA_HOME/common/lib/)
> I copied the example code straight from the URL and made following change to DBTest context
for >my system and mysql driver.
> <server.xml snippet>
> !-- Class name for mm.mysql JDBC driver -->
>                         <parameter>
>                                 <name>driverClassName</name>
>                                 <value>com.mysql.jdbc.Driver</value>
>                         </parameter>
>     <!-- The JDBC connection url for connecting to your MySQL dB.
>          The autoReconnect=true argument to the url makes sure that the
>          mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
>          connection.  mysqld by default closes idle connections after 8 hours.
>          -->
>                         <parameter>
>                                 <name>url</name>
>                                 <value>jdbc:mysql://<dns name of system>:3306/javatest?autoReconnect=true</value>
>                         </parameter>
>                 </ResourceParams>
> </server.xml snippet>
> I get following error in catalina.out when bringing up test.jsp that uses the datasource.
> <catalina.out error>
>         DBCP borrowObject failed: java.sql.SQLException: Server connection failure during
> Does any one have any advice on what may be wrong?
> I have successfully configured Tomcat 4.1.24 using the JNDI datasource howto example
code on >Windows 2000 using mysql-connector-java-3.0.8-stable-bin.jar, with MySQL 3.23.44.

Is that server.xml snippet in <GlobalResourceParams> or its own
<Context>? It needs to be in its own <Context>. Also, where are your
username and password defined? I'm using 4.1.24, and I get a message in
catalina.out if I leave those out (they should be defined in the
<ResourceParams> as parameters). According to some other questions I've
seen about this, that error often comes up due to a permissions problem
with MySQL - does the user you're using have access rights (in MySQL)
for the db?

Lynn Hollerman.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message