Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0967FB5DC56 for ; Wed, 10 Aug 2011 15:45:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 77902-03 for ; Wed, 10 Aug 2011 18:45:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.softperience.eu (static-ip-217-118-26-141.inaddr.intergenia.de [217.118.26.141]) by mail.postgresql.org (Postfix) with ESMTP id 2EC73B5DC50 for ; Wed, 10 Aug 2011 15:45:49 -0300 (ADT) Received: from radek.localnet (cek188.neoplus.adsl.tpnet.pl [83.30.186.188]) by mail.softperience.eu (Postfix) with ESMTPA id 3E5D8C0007A; Wed, 10 Aug 2011 20:45:47 +0200 (CEST) From: =?utf-8?q?Rados=C5=82aw_Smogura?= To: Alex Nordlund Subject: Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Date: Wed, 10 Aug 2011 20:45:57 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.39-gentoo-r3; KDE/4.6.3; x86_64; ; ) Cc: pgsql-jdbc@postgresql.org References: <004836884de8429682df2eac29aa0548@mail.softperience.eu> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201108102045.57813.rsmogura@softperience.eu> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201108/36 X-Sequence-Number: 22068 Ok, Try add following for your Tomact's Java (I haven't worked for years with=20 Tomcat but there may be run.bat, run.sh, it will be probaly somewhere near = "- mx"): =2DDjava.net.preferIPv4Stack=3Dtrue and/or (on Linux) echo 0 > /proc/sys/net/ipv6/bindv6only and/or expose PostgreSQL on IPv6, and change hostname to ::1 Regards, Radek Alex Nordlund Wednesday 10 of August 2011 18:48:= 34 > Hi, >=20 > Same result with 127.0.0.1 >=20 > 2011-08-10 13:14:30,615 main ERROR > [org.hibernate.util.JDBCExceptionReporter] Cannot create > PoolableConnectionFactory (The connection attempt failed.) > 2011-08-10 13:14:30,618 main WARN [org.hibernate.cfg.SettingsFactory] > Could not obtain connection metadata > org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create > PoolableConnectionFactory (The connection attempt failed.) > [snip 60 lines] > Caused by: org.postgresql.util.PSQLException: The connection attempt > failed. >=20 > With risk for looping (my eyes are tired and do not easily spot where > the log ends) I have the full log here. > http://dpaste.org/6O5d/ >=20 >=20 > --- > //Alex >=20 >=20 >=20 > On Wed, Aug 10, 2011 at 5:31 PM, Rados=C5=82aw Smogura >=20 > wrote: > > So it's harder topic, > > - try to replace localhost with 127.0.0.1 > > I don't know why You don't have (didn't send) PostgreSQL exception, try > > to connect to server with simple servlet, using old fashioned JNDI, > > check hibernate configuration. > >=20 > > It's hard to see if You have passed wrong JNDI name, you have no driver > > in classpath, or it's PostgreSQL exception. Send full backtrace of > > error. > >=20 > > Regards > >=20 > > On Wed, 10 Aug 2011 17:19:13 +0100, Alex Nordlund wrote: > >> Hi Radoslaw, > >>=20 > >> Thank you for your reply. > >>=20 > >> I can confirm that with psql --host=3D127.0.0.1 it works, however it > >> still does not work with jdbc. > >>=20 > >> --- > >> //Alex > >>=20 > >>=20 > >>=20 > >> On Wed, Aug 10, 2011 at 5:13 PM, Rados=C5=82aw Smogura > >>=20 > >> wrote: > >>> Hi, > >>>=20 > >>> Check your "access file" pga_hba.conf if it allows TCP/IP connections. > >>> By default psql connects on Unix socket > >>> try to connect using > >>> psql --host=3D127.0.0.0.1 --port=3D5432 -U crowd crowdiddb > >>>=20 > >>> I this fail You probably didn't exposed TCP/IP access (or You have > >>> localhost > >>> firewall?). > >>>=20 > >>> Regards, > >>> Rados=C5=82aw Smogura > >>>=20 > >>> On Wed, 10 Aug 2011 13:53:59 +0100, Alex Nordlund wrote: > >>>> Hi, > >>>>=20 > >>>> I get the following errors: > >>>>=20 > >>>> INFO: Deploying configuration descriptor openidserver.xml > >>>> 2011-08-10 13:14:30,600 main WARN > >>>> [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: > >>>> null > >>>> 2011-08-10 13:14:30,615 main ERROR > >>>> [org.hibernate.util.JDBCExceptionReporter] Cannot create > >>>> PoolableConnectionFactory (The connection attempt failed.) > >>>> 2011-08-10 13:14:30,618 main WARN [org.hibernate.cfg.SettingsFactory] > >>>> Could not obtain connection metadata > >>>> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create > >>>> PoolableConnectionFactory (The connection attempt failed. > >>>>=20 > >>>> And my Resource looks like this: > >>>>=20 > >>>> >>>> type=3D"javax.sql.DataSource" > >>>> username=3D"crowd" > >>>> password=3D"hiddenfortheml" > >>>> driverClassName=3D"org.postgresql.Driver" > >>>> url=3D"jdbc:postgresql://localhost:5432/crowdiddb" > >>>> /> > >>>>=20 > >>>>=20 > >>>> Am I doing something wrong? > >>>>=20 > >>>> My username is crowd, it's set to only use MD5 auth, the DB is > >>>> crowdiddb and I can access it using psql. > >>>>=20 > >>>> --- > >>>> //Alex