Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A4219B5DBD6 for ; Wed, 10 Aug 2011 15:54:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 01566-02 for ; Wed, 10 Aug 2011 18:54:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vx0-f174.google.com (mail-vx0-f174.google.com [209.85.220.174]) by mail.postgresql.org (Postfix) with ESMTP id 2B166B5DC26 for ; Wed, 10 Aug 2011 15:54:04 -0300 (ADT) Received: by vxi9 with SMTP id 9so1068258vxi.19 for ; Wed, 10 Aug 2011 11:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=nIOcpgpIURCAvZb8NzM5phVTY1FlChqHFpkhA1pBlQI=; b=ctMGsMf/R07hWPVJTPkuDFzb4O+7YCV46F+r9uB3UQtAdkOZ2m4J4blM6tSRExRVAf G0dmstZc3u6OMIgAdYVOfABEy5hxWopi8jlrO9stJ3xRCFzWPLgVpGbsFdYjYN7MsIAs HZqbF5XYVHn1dZRdYadjWmTvnFYd3B+5v05BY= Received: by 10.52.21.73 with SMTP id t9mr396007vde.70.1313002443232; Wed, 10 Aug 2011 11:54:03 -0700 (PDT) Received: from [192.168.0.221] (office.vivisimo.com [206.210.75.84]) by mx.google.com with ESMTPS id n5sm576311vcw.32.2011.08.10.11.54.02 (version=SSLv3 cipher=OTHER); Wed, 10 Aug 2011 11:54:02 -0700 (PDT) Message-ID: <4E42D3C9.4010904@acm.org> Date: Wed, 10 Aug 2011 14:54:01 -0400 From: Bruce Adams User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Cannot create PoolableConnectionFactory (The connection attempt failed.) References: <004836884de8429682df2eac29aa0548@mail.softperience.eu> <201108102045.57813.rsmogura@softperience.eu> In-Reply-To: <201108102045.57813.rsmogura@softperience.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.889 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201108/37 X-Sequence-Number: 22069 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 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 >> >> 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 >>>> >>>> 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: >>>>>> >>>>>> >>>>> 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