Re: Problems connecting to postgres using JDBC Driver.

From: "Neil Peter Braggio" <pbraggio(at)gmail(dot)com>
To: Daniel Muñoz <daniel(dot)munoz(at)karinasoft(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Problems connecting to postgres using JDBC Driver.
Date: 2007-08-27 21:28:29
Message-ID: a722ba580708271428p12422650ue44c2fd8fef870cd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Check the parameter listen_addresses in the postgresql.conf file to set the
correct value for you (may be '*' to test).

Remove or comment the first host entry. I guess it is not a valid
CIDR-ADDRESS value ;-)

Restart your server and try again your java application.

----
Neil Peter Braggio
pbraggio(at)gmail(dot)com

On 8/27/07, Daniel Muñoz <daniel(dot)munoz(at)karinasoft(dot)com> wrote:
>
> Hello. I need your help.
>
> I have a box running Fedora Core 6. I installed the Postgres Server using
> yum, so i have the distributing software.
>
> Ever since i installed it im having problems connecting my java
> applications to the database.
>
> But first thing first:
>
> This is the error message i get when connecting to the database:
> Checking if Driver is registered with DriverManager.
> Registered the driver ok, so let's make a connection.
> Couldn't connect: print out a stack trace and exit.
> org.postgresql.util.PSQLException: FATAL: missing or erroneous pg_hba.conf
> file
> at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(
> ConnectionFactoryImpl.java :275)
> at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl
> (ConnectionFactoryImpl.java:94)
> 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:171)
> at Connect.main(Connect.java:26)
>
>
> the pg_hba.conf file is located in: /var/lib/pgsql/data and it looks
> like this:
>
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
>
> # "local" is for Unix domain socket connections only
> #local all all ident sameuser
> local all all md5
> # IPv4 local connections:
> #host all all 127.0.0.1/32 ident sameuser
> host all all ubuntu md5
> host all all 127.0.0.1/32 md5
> # IPv6 local connections:
> #host all all ::1/128 ident sameuser
> host all all ::1/128 md5
>
>
> somewhere I read that i should live a blank line at the very bottom of the
> file, so i have... Also, i have checked that each value is separated by a
> tab. Also, i read that the PATH and the LD_LIBRARY_PATH should include the
> path to the postgres configuration. So on /etc/bashrc i have the following:
>
>
> export LD_LIBRARY_PATH=$JMFHOME/lib:/var/lib/pgsql/data/:$LD_LIBRARY_PATH
> export PATH=/var/lib/pgsql/data/:$PATH
>
>
> Now, this is the weird thing... I can connect using the psql client.
>
> psql -t template1 -U damunoz
> and then entering the password....
>
> So I have no idea what is going on... I tested with different drivers
> with the same results. My guess is that maybe this has something to do with
> the Fedora's distribution. I will post this same message to them as well.
>
> Thanks in advance for your help!
>
> daniel
>
>
>
> --
> ========================
> Daniel Muñoz Honiball
> daniel(dot)munoz(at)karinasoft(dot)com
> www.karinasoft.com
> Software para la Gloria de Dios.
>
> Si se humillare mi pueblo, sobre los cuales ni nombre es invocado, y
> oraren,
> y buscaren mi rostro, y se convirtieren de sus malos caminos;
> entonces yo oiré desde los cielos, y perdonaré sus pecados, y sanaré su
> tierra.
> 2 Crónicas 7-14

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2007-08-27 21:40:25 Re: Copy cmd error
Previous Message Daniel Muñoz 2007-08-27 20:42:05 Problems connecting to postgres using JDBC Driver.