Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 7E0929FB402 for ; Mon, 27 Aug 2007 18:28:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 38326-05 for ; Mon, 27 Aug 2007 18:28:29 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.185]) by postgresql.org (Postfix) with ESMTP id 2C8349FB3FC for ; Mon, 27 Aug 2007 18:28:31 -0300 (ADT) Received: by fk-out-0910.google.com with SMTP id b27so1670306fka for ; Mon, 27 Aug 2007 14:28:30 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=dGb3DstfPGKf08qYxi5hMfI+KZ+w8QgPvqlbXR2j34zlycXD9Z/9DJGcMkPZZXNIBLfh/rFHGEkNGZK4JV0noADQZ3TGWBBpV4YxMg4nqIpSy/jh2jNWwji6sTxSo7YXfJqB6of2NzMpPMZZAHvy58JS702qqEYulcWPxF2VpX4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=CRkzyUBoxqqDNlPPSz6PmQwbGRhlP77QlhyFOR9VdCcjvfidUrm2mKFv8l3DaaVdE8BbiL6LZMluf0ieZqnqnM14qLeKuIPJqUZzEJEYtB5G1gfApJAf+NDKTq85C7iF5Z8+Kz5JA+6VxfwH1sXXaEEjE0eaaHN+HtuJXLwmGSY= Received: by 10.82.175.17 with SMTP id x17mr15045923bue.1188250109553; Mon, 27 Aug 2007 14:28:29 -0700 (PDT) Received: by 10.82.108.13 with HTTP; Mon, 27 Aug 2007 14:28:29 -0700 (PDT) Message-ID: Date: Mon, 27 Aug 2007 14:28:29 -0700 From: "Neil Peter Braggio" To: "=?ISO-8859-1?Q?Daniel_Mu=F1oz?=" Subject: Re: Problems connecting to postgres using JDBC Driver. Cc: pgsql-admin@postgresql.org In-Reply-To: <499c4b1b0708271342r1ab7bf86gef85be56fb015580@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_97113_32902311.1188250109014" References: <499c4b1b0708271342r1ab7bf86gef85be56fb015580@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.544 tagged_above=0 required=5 tests=AWL=-0.542, BAYES_50=0.001, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, URIBL_RHS_DOB=1.083 X-Spam-Level: X-Archive-Number: 200708/333 X-Sequence-Number: 26664 ------=_Part_97113_32902311.1188250109014 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Check the parameter listen_addresses in the postgresql.conf file to set th= e 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@gmail.com On 8/27/07, Daniel Mu=F1oz 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.con= f > file > at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication( > ConnectionFactoryImpl.java :275) > at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImp= l > (ConnectionFactoryImpl.java:94) > at org.postgresql.core.ConnectionFactory.openConnection( > ConnectionFactory.java:65) > at org.postgresql.jdbc2.AbstractJdbc2Connection.( > AbstractJdbc2Connection.java:116) > at org.postgresql.jdbc3.AbstractJdbc3Connection.( > AbstractJdbc3Connection.java:30) > at org.postgresql.jdbc3.Jdbc3Connection .( > 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 th= e > 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 t= he > path to the postgres configuration. So on /etc/bashrc i have the followi= ng: > > > export LD_LIBRARY_PATH=3D$JMFHOME/lib:/var/lib/pgsql/data/:$LD_LIBRARY_PA= TH > export PATH=3D/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 w= ith > the Fedora's distribution. I will post this same message to them as well= . > > Thanks in advance for your help! > > daniel > > > > -- > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Daniel Mu=F1oz Honiball > daniel.munoz@karinasoft.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=E9 desde los cielos, y perdonar=E9 sus pecados, y sanar= =E9 su > tierra. > 2 Cr=F3nicas 7-14 ------=_Part_97113_32902311.1188250109014 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Check the parameter  listen_addresses in the postgresql.conf file to s= et 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@g= mail.com


On 8/27/07, Daniel Mu=F1oz <danie= l.munoz@karinasoft.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 softwa= re.

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 Driver= Manager.
Registered the driver ok, so let's make a connection.
Couldn't connect: print out a stack trace and exit.
org.postgresql.u= til.PSQLException: FATAL: missing or erroneous pg_hba.conf file
 &n= bsp;      at org.postgresql.core.v3.ConnectionFact= oryImpl.doAuthentication(ConnectionFactoryImpl.java :275)
        at org.postgresql.core.= v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:94)<= br>        at org.postgresql.core.Connec= tionFactory.openConnection(ConnectionFactory.java:65)
   =      at=20 org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Conn= ection.java:116)
        at org.postg= resql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.ja= va:30)
        at org.postgresql.jdbc= 3.Jdbc3Connection .<init>(Jdbc3Connection.java:24)
     &nb= sp;  at org.postgresql.Driver.makeConnection(Driver.java:369)
 = ;       at org.postgresql.Driver.connect(Driv= er.java:245)
        at java.sql.Driv= erManager.getConnection(DriverManager.java :525)
        at java.sql.DriverManag= er.getConnection(DriverManager.java:171)
     &= nbsp;  at Connect.main(Connect.java:26)


the pg_hba.conf fil= e is located in:  /var/lib/pgsql/data    and it looks l= ike this:

# TYPE  DATABASE    USER    &nb= sp;   CIDR-ADDRESS        = ;  METHOD

# "local" is for Unix domain socket connect= ions only
#local   all      &nbs= p;  all          &nb= sp;            =         ident sameuser
local &nb= sp; all     all      &nbs= p;      md5
# IPv4 local connections:
#host    all  &nb= sp;      all      &n= bsp;  127.0.0.1/32  &nbs= p;       ident sameuser
host  &n= bsp; all     all     ubuntu  m= d5
host    all     all   = ;  127.0.0.1/32    md5
# IPv6 local connections:
#hos= t    all         all=          ::1/128   &= nbsp;           ident sam= euser
host    all     all  =    ::1/128 md5


somewhere I read that i should live a b= lank line at the very bottom of the file, so i have...  Also, i have c= hecked that each value is separated by a tab.  Also, i read that the P= ATH and the LD_LIBRARY_PATH should include the path to the postgres configu= ration.  So on /etc/bashrc i have the following:

export LD_LIBRARY_PATH=3D$JMFHOME/lib:/var/lib/pgsql/data/:$LD_LIBR= ARY_PATH
export PATH=3D/var/lib/pgsql/data/:$PATH


Now, this i= s 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 goi= ng on...  I tested with different drivers with the same results. = My guess is that maybe this has something to do with the Fedora's dist= ribution.  I will post this same message to them as well.

Thanks in advance for your help!

daniel



--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D
Daniel Mu=F1oz Honiball
daniel.munoz@karinasoft.com
www.karinasoft.com
Software pa= ra 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=E9 desde los cielos, y perdonar=E9 sus pecados, y sanar= =E9 su tierra.
2 Cr=F3nicas 7-14

------=_Part_97113_32902311.1188250109014--