Skip site navigation (1) Skip section navigation (2)

Ident Connections With Tomcat and Postgresql

From: "Sam Elsamman" <elsamman(at)sitemagix(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Ident Connections With Tomcat and Postgresql
Date: 2007-12-06 14:42:32
Message-ID: (view raw or whole thread)
Lists: pgsql-jdbc
Has anyone had experience with IDENT authentication and JDBC with
Tomcat 5.5 and Postresql 8.2 using postgresql-8.2-506.jdbc3?

I set ident accross the board in pga_pg_hba.conf and restarted postgres

I set up an Ident service and I am able to connect using Ident with

su tomcat
psql -h locahost tomcat_test

But when I connect using JDBC under tomcat

String loginUser = "tomcat";
String loginUrl = "jdbc:postgresql://";
  dbcon = DriverManager.getConnection(loginUrl, loginUser, "");

I get "Ident authentication failed for user tomcat"

When I log at the postgres log I see:

LOG:  invalidly formatted response from Ident server: "47537 , 5432 :
FATAL:  Ident authentication failed for user "tomcat"
LOG:  invalidly formatted response from Ident server: "47541 , 5432 :
I started Tomcat using jsvc and confirmed it is running as tomcat and
confirmed via System.getProperty("") I was running as tomcat.

Also when I test ident standalone I get what appears to be good output

[root(at)host3 ~]# telnet localhost 113
Connected to localhost.localdomain (
Escape character is '^]'.
47568 , 5432 : USERID : Linux :tomcat
Connection closed by foreign host.
[root(at)host3 ~]#

This is a weird one.  Thanks in advance for any help on this.

pgsql-jdbc by date

Next:From: Peter KoczanDate: 2007-12-06 16:13:56
Subject: Re: JDBC and GSSAPI/Krb5
Previous:From: Usama DarDate: 2007-12-06 12:28:29
Subject: Re:

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group