I think this error message is fairly telling of your problem:

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory, cause:
java.sql.SQLException: Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.ConnectException)


Be sure the mysql daemon is running and listening on 3306. Netstat on the command line is good for that. Check your man pages for how to list listening ports since the command line seems to change from platform to platform. On my Linux box, it's netstat -tlnp. Options used: -t=show tcp only (no unix sockets), -l=show listening ports only, -n=don't resolve ips/ports to names, -p=show owning processes.

I don't think a firewall could cause this problem as most usually don't filter /dev/lo (localhost).

Goodluck!

--David

ilasno wrote:

hello,

i'm running tomcat 5.0.16 on debian linux with webmin, which provides mysql. i've created a test database, and set up a user with what i think are the proper permissions. here's the datasource resource from the server.xml that's nested within a context:

<Resource name="jdbc/dbName" auth="Container" type="javax.sql.DataSource" />

     <ResourceParams name="jdbc/dbName">

       <parameter>
           <name>factory</name>
           <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
         </parameter>

       <parameter>
           <name>maxActive</name>
           <value>100</value>
         </parameter>

       <parameter>
           <name>maxIdle</name>
           <value>30</value>
         </parameter>

       <parameter>
           <name>maxWait</name>
           <value>10000</value>
         </parameter>

       <parameter>
           <name>username</name>
           <value>xxxxxx</value>
         </parameter>

       <parameter>
           <name>password</name>
           <value>xxxxxx</value>
         </parameter>

       <parameter>
           <name>driverClassName</name>
           <value>org.gjt.mm.mysql.Driver</value>
         </parameter>

<parameter>
<name>url</name>
<value>jdbc:mysql://localhost/dbName?autoReconnect=true</value>
</parameter>


       <parameter>
           <name>removeAbandoned</name>
           <value>true</value>
         </parameter>

       <parameter>
           <name>logAbandoned</name>
           <value>true</value>
         </parameter>

     </ResourceParams>

but when i try to access, i get this exception, taken from the logs for that context:

2004-06-08 19:18:24 AbandonedObjectPool is used ([EMAIL PROTECTED])
LogAbandoned: true
RemoveAbandoned: true
RemoveAbandonedTimeout: 300
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory, cause:
java.sql.SQLException: Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.ConnectException)
at org.gjt.mm.mysql.Connection.connectionInit(Unknown Source)


incidentally (or maybe not), i have other datasources configured pretty much identically that work fine for another context that are connecting to remote mysql servers.

any suggestions?

thanks for your time.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to