pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedCannot create PoolableConnectionFactory (The connection attempt failed.)
9+ messages / 5 participants
[nested] [flat]
* Cannot create PoolableConnectionFactory (The connection attempt failed.)
@ 2011-08-10 12:53 Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:13 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
0 siblings, 1 reply; 9+ messages in thread
From: Alex Nordlund @ 2011-08-10 12:53 UTC (permalink / raw)
To: pgsql-jdbc
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
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
2011-08-10 12:53 Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
@ 2011-08-10 16:13 ` Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:19 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
0 siblings, 1 reply; 9+ messages in thread
From: Radosław Smogura @ 2011-08-10 16:13 UTC (permalink / raw)
To: Alex Nordlund <deep.alexander@gmail.com>; +Cc: pgsql-jdbc
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
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
2011-08-10 12:53 Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:13 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
@ 2011-08-10 16:19 ` Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:31 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
0 siblings, 1 reply; 9+ messages in thread
From: Alex Nordlund @ 2011-08-10 16:19 UTC (permalink / raw)
To: Radosław Smogura <rsmogura@softperience.eu>; +Cc: pgsql-jdbc
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@softperience.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
>
>
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
2011-08-10 12:53 Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:13 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:19 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
@ 2011-08-10 16:31 ` Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:48 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
0 siblings, 1 reply; 9+ messages in thread
From: Radosław Smogura @ 2011-08-10 16:31 UTC (permalink / raw)
To: Alex Nordlund <deep.alexander@gmail.com>; +Cc: pgsql-jdbc
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@softperience.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
>>
>>
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
2011-08-10 12:53 Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:13 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:19 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:31 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
@ 2011-08-10 16:48 ` Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 17:37 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Dave Cramer <pg@fastcrypt.com>
2011-08-10 18:45 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
0 siblings, 2 replies; 9+ messages in thread
From: Alex Nordlund @ 2011-08-10 16:48 UTC (permalink / raw)
To: Radosław Smogura <rsmogura@softperience.eu>; +Cc: pgsql-jdbc
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@softperience.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@softperience.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
>>>
>>>
>
>
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
2011-08-10 12:53 Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:13 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:19 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:31 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:48 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
@ 2011-08-10 17:37 ` Dave Cramer <pg@fastcrypt.com>
2011-08-10 17:45 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Andrew Hastie <andrew@ahastie.net>
1 sibling, 1 reply; 9+ messages in thread
From: Dave Cramer @ 2011-08-10 17:37 UTC (permalink / raw)
To: Alex Nordlund <deep.alexander@gmail.com>; +Cc: Radosław Smogura <rsmogura@softperience.eu>; 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.alexander@gmail.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@softperience.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@softperience.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@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
2011-08-10 12:53 Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:13 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:19 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:31 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:48 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 17:37 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Dave Cramer <pg@fastcrypt.com>
@ 2011-08-10 17:45 ` Andrew Hastie <andrew@ahastie.net>
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Hastie @ 2011-08-10 17:45 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I think your problem is how you are declaring your "resource".
The class "org.postgresql.Driver" does notimplement the
"javax.sql.DataSource" interface. If you're using the DataSource
interface (I'm guessing in an Application Server connection pool
declaration) then you need to specify the driverClassName as follows:-
Non-pooled connection = org.postgresql.ds.PGSimpleDataSource
Pooled connection = org.postgresql.ds.PGPoolingDataSource
XA Connection = org.postgresql.xa.PGXADataSource
At least this is how I'm defining my connections to Postgres using a
Glassfish V3 App Server.
Andrew
On 10/08/11 18:37, Dave Cramer wrote:
> 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.alexander@gmail.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@softperience.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@softperience.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@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
2011-08-10 12:53 Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:13 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:19 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:31 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:48 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
@ 2011-08-10 18:45 ` Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 18:54 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Bruce Adams <bruce.adams@acm.org>
1 sibling, 1 reply; 9+ messages in thread
From: Radosław Smogura @ 2011-08-10 18:45 UTC (permalink / raw)
To: Alex Nordlund <deep.alexander@gmail.com>; +Cc: pgsql-jdbc
Ok,
Try add following for your Tomact's Java (I haven't worked for years with
Tomcat but there may be run.bat, run.sh, it will be probaly somewhere near "-
mx"):
-Djava.net.preferIPv4Stack=true
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 <deep.alexander@gmail.com> Wednesday 10 of August 2011 18:48:34
> 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@softperience.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@softperience.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
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: Cannot create PoolableConnectionFactory (The connection attempt failed.)
2011-08-10 12:53 Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:13 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:19 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:31 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:48 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 18:45 ` Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) Radosław Smogura <rsmogura@softperience.eu>
@ 2011-08-10 18:54 ` Bruce Adams <bruce.adams@acm.org>
0 siblings, 0 replies; 9+ messages in thread
From: Bruce Adams @ 2011-08-10 18:54 UTC (permalink / raw)
To: pgsql-jdbc
For recent Tomcat releases, the clean place for Java options is in
bin/setenv.sh (for Unix-like platforms) and bin/setenv.bat (for
Windows). My specific example tunes Java heap stuff and tells Tomcat to
keep a pid file (which improves the behavior of Tomcat's shutdown script).
= setenv.bat =
set CATALINA_PID="%CATALINA_HOME%\temp\tomcat.pid"
set JAVA_OPTS=-Xmx1g -XX:MaxPermSize=256m
= setenv.sh =
export CATALINA_PID="$CATALINA_HOME/temp/tomcat.pid"
export JAVA_OPTS="-Xmx1g -XX:MaxPermSize=256m"
- Bruce
On 08/10/2011 02:45 PM, Radosław Smogura wrote:
> Ok,
>
> Try add following for your Tomact's Java (I haven't worked for years with
> Tomcat but there may be run.bat, run.sh, it will be probaly somewhere near "-
> mx"):
> -Djava.net.preferIPv4Stack=true
>
> 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<deep.alexander@gmail.com> Wednesday 10 of August 2011 18:48:34
>> 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@softperience.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@softperience.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
^ permalink raw reply [nested|flat] 9+ messages in thread
end of thread, other threads:[~2011-08-10 18:54 UTC | newest]
Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-08-10 12:53 Cannot create PoolableConnectionFactory (The connection attempt failed.) Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:13 ` Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:19 ` Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 16:31 ` Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 16:48 ` Alex Nordlund <deep.alexander@gmail.com>
2011-08-10 17:37 ` Dave Cramer <pg@fastcrypt.com>
2011-08-10 17:45 ` Andrew Hastie <andrew@ahastie.net>
2011-08-10 18:45 ` Radosław Smogura <rsmogura@softperience.eu>
2011-08-10 18:54 ` Bruce Adams <bruce.adams@acm.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox