org.postgresql.util.PSQLException

tip

Check if your server (or a proxy server) is not going up and down. There might be something between a proxy and a client sending intermittent requests to non-functioning hosts as well. There might as well be too many requests in a short amount of time.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Exception in thread "main" java.lang.Exception: The database server's error messages are not in English, however the installer requires them to be in English when using PostgreSQL earlier than 7.4. You either need to set "lc_messages = 'C'" in your postgresql.conf file and restart PostgreSQL or upgrade to PostgreSQL 7.4 or later. The installer executed the query "SELECT bogus_column_1249697930711 FROM bogus_table_1249697930711 WHERE another_bogus_column_1249697930711 IS NULL" and expected "does not exist" in the error message, but this exception was received instead: java.sql.SQLException: Could not get an administrative connection to the database. Is the database running, listening for TCP connections, and allowing us to connect and authenticate from localhost? Tried connecting to database specified by data source SimpleDataSource[URL='jdbc:postgresql://localhost:5432/template1', driver class='org.postgresql.Driver', properties: user='postgres', password='']. Original error: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. at org.opennms.netmgt.dao.db.InstallerDb.databaseCheckLanguage(InstallerDb.java:1610) at org.opennms.install.Installer.install(Installer.java:225) at org.opennms.install.Installer.main(Installer.java:858) Caused by: java.sql.SQLException: Could not get an administrative connection to the database. Is the database running, listening for TCP connections, and allowing us to connect and authenticate from localhost? Tried connecting to database specified by data source SimpleDataSource[URL='jdbc:postgresql://localhost:5432/template1', driver class='org.postgresql.Driver', properties: user='postgres', password='']. Original error: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. at org.opennms.netmgt.dao.db.InstallerDb.rethrowDatabaseConnectionException(InstallerDb.java:2243) at org.opennms.netmgt.dao.db.InstallerDb.initializeAdminConnection(InstallerDb.java:2220) at org.opennms.netmgt.dao.db.InstallerDb.getAdminConnection(InstallerDb.java:2209) at org.opennms.netmgt.dao.db.InstallerDb.databaseCheckLanguage(InstallerDb.java:1599) ... 2 more Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:122) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65) at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:116) at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30) at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24) at org.postgresql.Driver.makeConnection(Driver.java:369) at org.postgresql.Driver.connect(Driver.java:245) at java.sql.DriverManager.getConnection(DriverManager.java:525) at java.sql.DriverManager.getConnection(DriverManager.java:140) at org.opennms.netmgt.dao.db.SimpleDataSource.getConnection(SimpleDataSource.java:79) at org.opennms.netmgt.dao.db.InstallerDb.initializeAdminConnection(InstallerDb.java:2218) ... 4 more Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432) at java.net.Socket.connect(Socket.java:520) at java.net.Socket.connect(Socket.java:470) at java.net.Socket.<init>(Socket.java:367) at java.net.Socket.<init>(Socket.java:180) at org.postgresql.core.PGStream.<init>(PGStream.java:60) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:77) ... 14 more
    via by DJ Gregor,
  • Connection refused.
    via by Unknown author,
    • org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:122) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65) at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:116) at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30) at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24) at org.postgresql.Driver.makeConnection(Driver.java:369) at org.postgresql.Driver.connect(Driver.java:245) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:185) at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:65) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:974) at org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:176) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:207) at org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:550) at org.dspace.storage.rdbms.DatabaseManager.loadSql(DatabaseManager.java:923) at org.dspace.storage.rdbms.InitializeDatabase.main(InitializeDatabase.java:100) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at java.net.Socket.<init>(Socket.java:366) at java.net.Socket.<init>(Socket.java:180) at org.postgresql.core.PGStream.<init>(PGStream.java:60) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:77) ... 17 more

    Users with the same issue

    andyglickandyglick
    56 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    linxiaolonglinxiaolong
    377 times, last one,
    HandemelindoHandemelindo
    1 times, last one,
    820 more bugmates