Page 1 of 1

CLOSED: Server Login failure

PostPosted: Mon Sep 14, 2009 11:17 am
by dskanth
Hi, i have installed the Omero server and tried to start the server using the command "omero admin start". But iam not able to run the server, I got a log like this:

aused by: java.sql.SQLException: unable to connect to non-XA resource org.postgresql.Driver
at bitronix.tm.resource.jdbc.lrc.LrcXADataSource.getXAConnection(LrcXADataSource.java:82)
at bitronix.tm.resource.jdbc.PoolingDataSource.createPooledConnection(PoolingDataSource.java:167)
at bitronix.tm.resource.common.XAPool.createPooledObject(XAPool.java:200)
at bitronix.tm.resource.common.XAPool.grow(XAPool.java:310)
at bitronix.tm.resource.common.XAPool.getInPool(XAPool.java:289)
at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:72)
at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:58)
at bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:105)
... 100 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:123)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)
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:386)
at org.postgresql.Driver.connect(Driver.java:260)
at bitronix.tm.resource.jdbc.lrc.LrcXADataSource.getXAConnection(LrcXADataSource.java:79)
... 107 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.postgresql.core.PGStream.<init>(PGStream.java:62)


I could not understand, what could be the problem. Please help.

Re: Server Login failure

PostPosted: Tue Sep 15, 2009 7:18 am
by bernhard
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.


It seems that your postgres database is not running, or not configured to accept TCP/IP connections. If the db is up and you can't login on the command line, see below, check your pg_hba.conf file that lives in the postgres data folder. On my linux system this is in /var/lib/pgsql/data but that can differ between distributions. You need to have a host type connection allowed and likely with password authentication and not ident.
Code: Select all
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         postgres                          trust
local   all         all                               ident, sameuser
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5


To verify that your database is running and can be accessed using the user credentials you choose during the omero setup, try to connect from the command line (the example is on linux):

Code: Select all
$pgsql -U <your_omero_db_user> <you_omero_database_name>
Password:.....
# now you're logged in, try to run a query:
=> select * from experimenter;
# results are listed
=> \q


Cheers! Bernhard

Re: Server Login failure

PostPosted: Tue Sep 15, 2009 12:27 pm
by dskanth
Thanks a lot, now iam able to connect to the server, after adding my IP address in the file. :)