You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Raquepo <rr...@primeorion.com> on 2003/06/27 10:08:15 UTC

java.net.ConnectException: Connection refused

hi.

i have a struts application that is perfectly running in resin and tomcat in my win2k PC.

but then i put in our production server (debian linux) and i got this error:

Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused 

i can't connect to my MySQL Database because of that error:

  String connDriver = "org.gjt.mm.mysql.Driver";    //even tried com.mysql.jdbc.Driver
  String connURL = "jdbc:mysql://localhost:3306/charddb";
  String user = "root";
  String pass = "password";

i've check the database. it is working on my linux shell...

how come it doesn't work in my app.

thanks a lot.
-richard

RE: java.net.ConnectException: Connection refused

Posted by Filip Polsakiewicz <Fi...@innoface.de>.
... and see if mysql on your production server allows connections to
localhost. In my production enviroment mysql only allows connections to
jdbc:mysql://hostname:3306/mydb


> -----Original Message-----
> From: Richard Raquepo [mailto:rraquepo@primeorion.com]
> Sent: Friday, June 27, 2003 10:08 AM
> To: Struts Users Mailing List
> Subject: java.net.ConnectException: Connection refused
>
>
> hi.
>
> i have a struts application that is perfectly running in resin
> and tomcat in my win2k PC.
>
> but then i put in our production server (debian linux) and i got
> this error:
>
> Unable to connect to any hosts due to exception:
> java.net.ConnectException: Connection refused
>
> i can't connect to my MySQL Database because of that error:
>
>   String connDriver = "org.gjt.mm.mysql.Driver";    //even tried
> com.mysql.jdbc.Driver
>   String connURL = "jdbc:mysql://localhost:3306/charddb";
>   String user = "root";
>   String pass = "password";
>
> i've check the database. it is working on my linux shell...
>
> how come it doesn't work in my app.
>
> thanks a lot.
> -richard


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: java.net.ConnectException: Connection refused

Posted by Filip Polsakiewicz <Fi...@innoface.de>.
I'm not sure but maybe you have to allow the connections first. check
/etc/services if connections to port 3306 are allowed. And then you might
check
if connections to tomcat and your appserver are allowed.

HTH Filip

> -----Original Message-----
> From: Richard Raquepo [mailto:rraquepo@primeorion.com]
> Sent: Friday, June 27, 2003 10:08 AM
> To: Struts Users Mailing List
> Subject: java.net.ConnectException: Connection refused
>
>
> hi.
>
> i have a struts application that is perfectly running in resin
> and tomcat in my win2k PC.
>
> but then i put in our production server (debian linux) and i got
> this error:
>
> Unable to connect to any hosts due to exception:
> java.net.ConnectException: Connection refused
>
> i can't connect to my MySQL Database because of that error:
>
>   String connDriver = "org.gjt.mm.mysql.Driver";    //even tried
> com.mysql.jdbc.Driver
>   String connURL = "jdbc:mysql://localhost:3306/charddb";
>   String user = "root";
>   String pass = "password";
>
> i've check the database. it is working on my linux shell...
>
> how come it doesn't work in my app.
>
> thanks a lot.
> -richard


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org