Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Alex Nordlund <deep(dot)alexander(at)gmail(dot)com>
Cc: Radosław Smogura <rsmogura(at)softperience(dot)eu>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
Date: 2011-08-10 17:37:27
Message-ID: CADK3HHJs5dcrBLKuw6QuuHkCDp9hGxiypjaSLvEcCRx44FAaqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Looking at your stack trace it looks like the ultimate culprit is
"invalid argument" but your connection string looks OK. Can you try a
simple java connection without tomcat?

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On Wed, Aug 10, 2011 at 12:48 PM, Alex Nordlund
<deep(dot)alexander(at)gmail(dot)com> wrote:
> Hi,
>
> Same result with 127.0.0.1
>
> 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.
>
> 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/
>
>
> ---
> //Alex
>
>
>
> On Wed, Aug 10, 2011 at 5:31 PM, Radosław Smogura
> <rsmogura(at)softperience(dot)eu> 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.
>>
>> 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.
>>
>> Regards
>>
>> On Wed, 10 Aug 2011 17:19:13 +0100, Alex Nordlund wrote:
>>>
>>> Hi Radoslaw,
>>>
>>> Thank you for your reply.
>>>
>>> I can confirm that with psql --host=127.0.0.1 it works, however it
>>> still does not work with jdbc.
>>
>>> ---
>>> //Alex
>>>
>>>
>>>
>>> On Wed, Aug 10, 2011 at 5:13 PM, Radosław Smogura
>>> <rsmogura(at)softperience(dot)eu> wrote:
>>>>
>>>> Hi,
>>>>
>>>> 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=127.0.0.0.1 --port=5432 -U crowd crowdiddb
>>>>
>>>> I this fail You probably didn't exposed TCP/IP access (or You have
>>>> localhost
>>>> firewall?).
>>>>
>>>> Regards,
>>>> Radosław Smogura
>>>>
>>>> On Wed, 10 Aug 2011 13:53:59 +0100, Alex Nordlund wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I get the following errors:
>>>>>
>>>>> 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.
>>>>>
>>>>> And my Resource looks like this:
>>>>>
>>>>>    <Resource name="jdbc/CrowdIDDS" auth="Container"
>>>>> type="javax.sql.DataSource"
>>>>>              username="crowd"
>>>>>              password="hiddenfortheml"
>>>>>              driverClassName="org.postgresql.Driver"
>>>>>              url="jdbc:postgresql://localhost:5432/crowdiddb"
>>>>>            />
>>>>>
>>>>>
>>>>> Am I doing something wrong?
>>>>>
>>>>> My username is crowd, it's set to only use MD5 auth, the DB is
>>>>> crowdiddb and I can access it using psql.
>>>>>
>>>>> ---
>>>>> //Alex
>>>>
>>>>
>>
>>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Andrew Hastie 2011-08-10 17:45:13 Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
Previous Message Dave Cramer 2011-08-10 17:29:42 Re: Configurable Send/Receive Buffer Sizes