You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by "Owens, Ryan" <ro...@uhd.com> on 2003/02/11 00:44:03 UTC

Torque Error: Cannot connect to MySQL (full question)

Hi all.  Sorry about the half send last time.

I'm having a huge problem trying to deploy Torque to a client's webhost.
Any help would be hugely appreciated.

The host in running Ensim Site Administrator 3.1.4-1.
which uses Tomcat 4.0.3 and java 1.4  don't know the exact version.

I have tested the app thoroughly on my local machine with the same tomcat version with no problems.

For testing I have a jsp which connect directly to the db with sql.Connection, ResultSet etc
(not using torque) it yields:
Trying to connect to: jdbc:mysql://127.0.0.1:3306/mydb?user=u5er&password=password
- with driver: org.gjt.mm.mysql.Driver 
- connection = com.mysql.jdbc.jdbc2.Connection@b258fa 
Sterling Highway & Esther Drive 
SUCCESS!! 
the results on screen is an address from the db.
so my connection string and user/pass info is correct, and I can connect to the DB.

However, when running another test jsp from the same place using Torque I get:

org.apache.torque.TorqueException: Cannot connect to MySQL server on apollo.tilted.net:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.security.AccessControlException) STACK TRACE:
org.apache.torque.Torque.getConnection(Torque.java:901) 
org.apache.torque.Torque.getConnection(Torque.java:871) 
---------

the applicable torque properties are also printed out by my test jsp. They are:

prop:database.default.adapter=mysql 
prop:dsfactory.default.factory=org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory 
prop:dsfactory.default.pool.defaultMaxActive=30 
prop:dsfactory.default.pool.testOnBorrow=true 
prop:dsfactory.default.pool.validationQuery=SELECT 1 
prop:dsfactory.default.connection.driver=com.mysql.jdbc.Driver 
prop:dsfactory.default.connection.url=jdbc:mysql://127.0.0.1:3306/mydb
prop:dsfactory.default.connection.user=u5er 
prop:dsfactory.default.connection.password=password 


So I guess something in the DataSource isn't connecting properly???
Is there a possible security conflict or something?

This is a shared server, and all my jars are in my web-inf/lib dir.
The mysql-connector jar is in web-inf/lib as well, and it connects fine.

It wasn't working with a week old version of the torque plugin for maven, 
so I just rebuilt it and still no luck. 

Again, this whole thing works perfectly on my local machine running the same version of tomcat.

Thanks very much for any ideas!

   Ryan Owens


Re: Torque Error: Cannot connect to MySQL (full question)

Posted by Derick Fernando <de...@xenocex.com>.
Hello,

See if this thread helps any:
http://www.mail-archive.com/turbine-torque-user@jakarta.apache.org/msg01431.
html

HTH,
Derick

----- Original Message -----
From: "Owens, Ryan" <ro...@uhd.com>
To: "Owens, Ryan" <ro...@uhd.com>; "Turbine Torque Users List"
<to...@db.apache.org>
Sent: Monday, February 10, 2003 3:44 PM
Subject: Torque Error: Cannot connect to MySQL (full question)


> Hi all.  Sorry about the half send last time.
>
> I'm having a huge problem trying to deploy Torque to a client's webhost.
> Any help would be hugely appreciated.
>
> The host in running Ensim Site Administrator 3.1.4-1.
> which uses Tomcat 4.0.3 and java 1.4  don't know the exact version.
>
> I have tested the app thoroughly on my local machine with the same tomcat
version with no problems.
>
> For testing I have a jsp which connect directly to the db with
sql.Connection, ResultSet etc
> (not using torque) it yields:
> Trying to connect to:
jdbc:mysql://127.0.0.1:3306/mydb?user=u5er&password=password
> - with driver: org.gjt.mm.mysql.Driver
> - connection = com.mysql.jdbc.jdbc2.Connection@b258fa
> Sterling Highway & Esther Drive
> SUCCESS!!
> the results on screen is an address from the db.
> so my connection string and user/pass info is correct, and I can connect
to the DB.
>
> However, when running another test jsp from the same place using Torque I
get:
>
> org.apache.torque.TorqueException: Cannot connect to MySQL server on
apollo.tilted.net:3306. Is there a MySQL server running on the machine/port
you are trying to connect to? (java.security.AccessControlException) STACK
TRACE:
> org.apache.torque.Torque.getConnection(Torque.java:901)
> org.apache.torque.Torque.getConnection(Torque.java:871)
> ---------
>
> the applicable torque properties are also printed out by my test jsp. They
are:
>
> prop:database.default.adapter=mysql
>
prop:dsfactory.default.factory=org.apache.torque.dsfactory.Jdbc2PoolDataSour
ceFactory
> prop:dsfactory.default.pool.defaultMaxActive=30
> prop:dsfactory.default.pool.testOnBorrow=true
> prop:dsfactory.default.pool.validationQuery=SELECT 1
> prop:dsfactory.default.connection.driver=com.mysql.jdbc.Driver
> prop:dsfactory.default.connection.url=jdbc:mysql://127.0.0.1:3306/mydb
> prop:dsfactory.default.connection.user=u5er
> prop:dsfactory.default.connection.password=password
>
>
> So I guess something in the DataSource isn't connecting properly???
> Is there a possible security conflict or something?
>
> This is a shared server, and all my jars are in my web-inf/lib dir.
> The mysql-connector jar is in web-inf/lib as well, and it connects fine.
>
> It wasn't working with a week old version of the torque plugin for maven,
> so I just rebuilt it and still no luck.
>
> Again, this whole thing works perfectly on my local machine running the
same version of tomcat.
>
> Thanks very much for any ideas!
>
>    Ryan Owens
>
>