Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WU8JI-00004w-AU for pgsql-jdbc@arkaria.postgresql.org; Sun, 30 Mar 2014 05:29:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WU8JH-0003gb-NS for pgsql-jdbc@arkaria.postgresql.org; Sun, 30 Mar 2014 05:29:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WU8JG-0003gU-Oo for pgsql-jdbc@postgresql.org; Sun, 30 Mar 2014 05:29:30 +0000 Received: from mail-oa0-x236.google.com ([2607:f8b0:4003:c02::236]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WU8JE-0006ax-Jc for pgsql-jdbc@postgresql.org; Sun, 30 Mar 2014 05:29:30 +0000 Received: by mail-oa0-f54.google.com with SMTP id n16so7973291oag.27 for ; Sat, 29 Mar 2014 22:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gsaDU7m+5imBoucqjgnWMg+X8PpA6V+aUaKi4VeUtN8=; b=z7d5p4A6cX1KlOApHdwoohVkKVy6B1T3S+pNDOklEhxu9r8Se5eq9SdTqeJ5Is9C5H I7gNjsAeEpJg55FtcLJ9EyTcZV2+8m6IZo+Gb2bOSpvhH0b9ViW1J4YWeaxdj2n5VBbK Thh7xIsbx1tTDzhr5Ii1EKKOj7CRIgOGoBz7cQNcfDfBfjFFK56QHpGMzC5E+QaRa6at uhMZTQ7k88umi5827Xvzayh/yrOp/yY3/+OPZi1ekgx677qOh7pAoSHNbtZCRY4Eopga 5aiE4lzpYKUYv+L4VT5yb0shvyi25MnYDpjtLynsPaoTl3yPfNqWcudJk/fyzlgqcHKX BL0w== X-Received: by 10.182.200.131 with SMTP id js3mr15402834obc.0.1396157365556; Sat, 29 Mar 2014 22:29:25 -0700 (PDT) Received: from [172.20.10.3] ([166.137.122.196]) by mx.google.com with ESMTPSA id ec8sm17543755obb.18.2014.03.29.22.29.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 29 Mar 2014 22:29:23 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: pgsql jdbc db connection weird behaviour From: Steven Schlansker In-Reply-To: Date: Sun, 30 Mar 2014 00:29:22 -0500 Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <078EE923-CCF6-45FA-B0EB-C18FC42C0D5B@gmail.com> References: To: Venkateswar Reddy Melachervu X-Mailer: Apple Mail (2.1874) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On Mar 30, 2014, at 12:10 AM, Venkateswar Reddy Melachervu wrote: > Hello PGSQL Community, > Love pgsql. But facing this weird problem (detailed below) for past coupl= e of days with pgsql jdbc41 driver with tomcat 8 connection pooling on on j= vm1.8 (all on x64 windows 8) with no resolution in sight for casting a jdbc= db tomcat pooled connection to PGConnection hitting the wall.=20 >=20 > I am sure not sure if I am doing something silly or it is the limitation = of pgsql jdbc41 driver. Did any one face any such issue? Does any one know = some way out for this? >=20 > Problem: > When I try to cast a DB Connection obtained using tomcat jdbc resource (p= ooled) to org.postgresql.PGConnection, of course after unwrapping it, execu= tion is running into exception with the message: (java.lang.ClassCastExcept= ion) java.lang.ClassCastException: org.postgresql.jdbc4.Jdbc4Connection can= not be cast to org.postgresql.PGConnection Almost always this is caused by having more than one driver jar file availa= ble in your class path. In particular, bundling a driver in the Tomcat lib= / directory as well as within your application itself is sure to cause prob= lems. That=92s where I would look first. Hope that helps, Steven --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc