java.net.ConnectException: Connection refused

Use this forum for questions regarding installation, upgrading and configuration of OpenEMM

Moderator: moderator

hobbss
Posts: 6
Joined: Sun Oct 01, 2006 4:50 pm
Location: Gibraltar
Contact:

java.net.ConnectException: Connection refused

Post by hobbss » Sun Oct 01, 2006 7:15 pm

Setup everything as per install doc (except sendmail stuff - see other posts)

Created a db user called openemm, and a database called openemm. Database creation worked except the last two statements which tried to grant privileges to "agnitas". I ignored these errors as the script didnt create the user, and there is no mention of it in the install instructions, so assumed it was a mistake. I dont want to (and cant - dont have root password) run the db under the root user.

When I hit my domain on port 8081, I get a nice error:

Ein Fehler ist aufgetreten
Ursache: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Ruler' defined in ServletContext resource [/WEB-INF/cronContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.agnitas.backend.RulerImpl]; constructor threw exception; nested exception is org.agnitas.util.ConfigException: Database setup failed: java.lang.Exception: Error initializing database connection: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection refused STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection refused at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:284) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555) at com.mysql.jdbc.Connection.(Connection.java:1485) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at java.sql.DriverManager.getConnection(DriverManager.java:525) at java.sql.DriverManager.getConnection(DriverManager.java:171) at org.agnitas.backend.DBase.(DBase.java:91) at org.agnitas.backend.Data.mkDBase(Data.java:295) at org.agnitas.backend.Data.setupDatabase(Data.java:305) at org.agnitas.backend.Data.(Data.java:1025) at org.agnitas.backend.RulerImpl.mkData(RulerImpl.java:95) at org.agnitas.backend.RulerImpl.(RulerImpl.java:106) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
:
stuff deleted
:

I hacked around a bit and found a file in WEB-INF/classes called emm.properties. I notice there is a user called agnitas with a password of openemm!

I created this user in plesk for the db openemm.

I then did:

mysql -u openemm -p openemm
(enered password)
and at the mysql> prompt tried:

GRANT DELETE, INSERT, UPDATE, LOCK TABLES, SELECT, CREATE TEMPORARY TABLES ON openemm.* TO 'agnitas'@'localhost' IDENTIFIED BY 'openemm';

But get:

ERROR 1044 (42000): Access denied for user 'openemm'@'%' to database 'openemm'

I tried stopping and starting OpemEMM with the new user defined for the DB, but get the same "Ein Fehler ist aufgetreten..." when I hit the url.

hobbss
Posts: 6
Joined: Sun Oct 01, 2006 4:50 pm
Location: Gibraltar
Contact:

Post by hobbss » Sun Oct 01, 2006 7:27 pm

Found that plesk have disabled the root user, and it is instead "admin". Loged in with admin to mysql and ran

GRANT DELETE, INSERT, UPDATE, LOCK TABLES, SELECT, CREATE TEMPORARY TABLES ON openemm.* TO 'agnitas'@'localhost' IDENTIFIED BY 'openemm';

GRANT ALTER ON openemm.customer_1_tbl TO 'agnitas'@'localhost' IDENTIFIED BY 'openemm';

without error.

stopped and started openem, but still get the same:

Java.net.SocketException: java.net.ConnectException: Connection refused at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:284)

Any ideas?

krull
Posts: 5
Joined: Sat Sep 09, 2006 11:07 am

Post by krull » Mon Oct 30, 2006 10:19 am

#bind-address = 127.0.0.1

in the /etc/mysql/my.cnf

If you comment that out, mysql will allow the whole network to connect. You already added the user with the external IP.
Try commenting it out for testing purpose. You should not run mysql with this enabled, because somebody can connect to your host now.

But perhaps this will bring you closer to the problem :)

Post Reply