Desesperado con el pool JDBC en Tomcat4+Mysql

Rah
09 de Julio del 2004
Quiero conectar mediante un pool de conexiones a mysql desde tomcat4.
Usando el driver de Jakarta (com.mysql.jdbc.Driver) me da este error:
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unable to connect to any hosts due to exception: java.net.ConnectException: Conexión rehusada ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Conexión rehusada STACKTRACE: java.net.ConnectException: Conexión rehusada at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:355) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:142) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:129) at java.net.Socket.(Socket.java:273) at java.net.Socket.(Socket.java:100) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:121) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:220) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1768) at com.mysql.jdbc.Connection.(Connection.java:440) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at directorio.DatosDlg.processRequest(DatosDlg.java:62) at directorio.DatosDlg.doGet(DatosDlg.java:91) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
.....

Si uso el driver de mark mathews (org.gjt.mm.mysql.Driver) me da el típico error de:

Cannot connect to MySQL server on 10.0.1.252:3206. Is there a MySQL server running on machine/port you are trying to connect to?.....


puedo conectar a MySQL de mil formas :
con el cliente ("mysql -h 10.0.1.252 -P3306 -p" tambien con localhost y 127.0.0.1)
desde apache+phpmysqladmin

¿Me podríais dar un pista por favor?

tengo el jdk 1.3

en mi server.xml tengo:

<ResourceParams name="jdbc/dsSustrato">

<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://10.0.1.252:3206/sustrato2</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
<!-- com.mysql.jdbc.Driver
org.gjt.mm.mysql.Driver-->
</parameter>
<parameter>
<name>username</name>
<value>raul</value>
</parameter>
<parameter>
<name>password</name>
<value>******</value>
</parameter>
</ResourceParams>
</Context>

</Host>

</Engine>

</Service>

En mi catalina/common/lib tengo:

-rwxrw-rw- 1 raul informat 175426 may 26 20:50 commons-collections-2.1.1.jar
-rwxrw-rw- 1 raul informat 107631 jun 12 15:42 commons-dbcp-1.2.1.jar
-rwxrw-rw- 1 raul informat 26202 jun 15 21:29 commons-logging-api.jar
-rwxrw-rw- 1 raul informat 38015 jun 15 21:29 commons-logging.jar
-rwxrw-rw- 1 raul informat 42492 jun 7 19:40 commons-pool-1.2.jar
-rwxrw-rw- 1 raul informat 6727 jul 5 14:18 jdbc2_0-stdext.jar
-rwxrw-rw- 1 raul informat 68043 feb 12 1999 jndi.jar
-rwxr--r-- 1 root root 236956 jul 7 15:01 mysql-connector-java-3.0.14-production-bin.jar
-rw-r--r-- 1 root root 23667 oct 13 2003 naming-common.jar
-rw-r--r-- 1 root root 36203 oct 13 2003 naming-resources.jar
lrwxrwxrwx 1 root root 29 jul 2 12:57 servlet.jar -> ../../../java/servlet-2.3.jar
lrwxrwxrwx 1 root root 28 jul 2 12:57 xercesImpl.jar -> ../../../java/xercesImpl.jar
lrwxrwxrwx 1 root root 31 jul 2 12:57 xmlParserAPIs.jar -> ../../../java/xmlParserAPIs.jar

En catalina.ploicy tengo:

grant {
permission java.security.AllPermission;
};

grant codeBase "file:${catalina.home}/common/lib/mysql-connector-java-3.0.14-production-bin.jar!/-" {
permission java.net.SocketPermission "127.0.0.1:3206", "accept,connect,resolve";
};



Muchísimas gracias

maramonar
09 de Julio del 2004
El puerto es 3206 o 3306??? porque en la configuración pones 3206, pero cuando decis que podes acceder vía el cliente pones 3306.