From batymohn@yahoo.com Tue Sep 4 14:11:19 2007 Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 7641A9F9FE6 for ; Tue, 4 Sep 2007 11:11:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 73758-09 for ; Tue, 4 Sep 2007 11:11:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web81605.mail.mud.yahoo.com (web81605.mail.mud.yahoo.com [68.142.199.157]) by postgresql.org (Postfix) with SMTP id B3BDD9F9F81 for ; Tue, 4 Sep 2007 11:11:14 -0300 (ADT) Received: (qmail 151 invoked by uid 60001); 4 Sep 2007 14:11:13 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=NgrTwOTPGRbmK5RP8wQgnyVHEfSXGDTWkcPZ+UH04zWApn3d79xTLvmRZo4a2n9moaXaBhST0tefDCw/QwW1sZ/SCcRS+no4tAwcgTLmXt6Gl1be7bzX5WpCQiFOr6QOfAp95UTb/GSAx2sX/aVf6DqoQOMAnewg9WlCK1gWscY=; X-YMail-OSG: DK1CUzYVM1krwAvLWkqpwonR3JeEcEJveBwjfFOihBDItp06SE03UcUsD4aMXRNTtQ-- Received: from [134.215.217.230] by web81605.mail.mud.yahoo.com via HTTP; Tue, 04 Sep 2007 07:11:12 PDT X-Mailer: YahooMailRC/651.48 YahooMailWebService/0.7.134 Date: Tue, 4 Sep 2007 07:11:12 -0700 (PDT) From: Chris Baty Subject: JDBC driver works in ccommand line, not in Tomcat5 To: pgsql-jdbc@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-346346439-1188915072=:98645" Message-ID: <4140.98645.qm@web81605.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/7 X-Sequence-Number: 17429 --0-346346439-1188915072=:98645 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Hi Guys,=0AI'm trying to get Tomcat 5 to access psql. I created a "test' = database and put several drivers in common/lib. I keep getting =0A=0Aorg.p= ostgresql.util.PSQLException: Something unusual has occured to cause the dr= iver to fail. Please report this exception.=0A=0Ain my log files. This s= ame drive worked fine in a test program I wrote in the command line progr= am.=0A=0ADoes aneone know what might be happening?=0A=0AThanks.=0AChris=0A= =0A=0A =0A___________________________________________________________= _________________________Ready for the edge of your seat? =0ACheck out toni= ght's top picks on Yahoo! TV. =0Ahttp://tv.yahoo.com/ --0-346346439-1188915072=:98645 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable
Hi Guys,
=0A
I'm trying to get Tomcat 5 to&nb= sp; access psql.  I created a "test' database and put several drivers = in common/lib.  I keep getting
=0A
 
=0A
org.p= ostgresql.util.PSQLException: Something unusual has occured to cause the dr= iver to fail. Please report this exception.
=0A
in my log = ; files.  This  same drive worked fine in a test  program I = wrote in  the command line program.
=0A
 
=0A
D= oes aneone know what might be  happening?
=0A
 
=0A=
Thanks.
=0A
Chris

=0A
Yahoo!= oneSearch: Finally, mobile search =0Athat= gives answers, not web links. =0A=0A --0-346346439-1188915072=:98645-- From giuseppe@eppesuigoccas.homedns.org Wed Sep 5 01:54:17 2007 Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 5B24C9FA15F for ; Tue, 4 Sep 2007 22:54:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 24125-03 for ; Tue, 4 Sep 2007 22:54:05 -0300 (ADT) X-Greylist: delayed 00:17:49.19891 by SQLgrey-1.7.5 Received: from eppesuigoccas.homedns.org (host112-215-dynamic.1-79-r.retail.telecomitalia.it [79.1.215.112]) by postgresql.org (Postfix) with ESMTP id E98C79FA15A for ; Tue, 4 Sep 2007 22:54:13 -0300 (ADT) Received: from casa ([192.168.2.34] helo=eppesuigoccas.homedns.org) by eppesuigoccas.homedns.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1ISjoj-00017A-OF for pgsql-jdbc@postgresql.org; Wed, 05 Sep 2007 03:36:31 +0200 Received: from giuseppe by eppesuigoccas.homedns.org with local (Exim 4.63) (envelope-from ) id 1ISjjY-00017a-F0 for pgsql-jdbc@postgresql.org; Wed, 05 Sep 2007 03:31:08 +0200 Subject: Re: JDBC driver works in ccommand line, not in Tomcat5 From: Giuseppe Sacco To: pgsql-jdbc@postgresql.org In-Reply-To: <4140.98645.qm@web81605.mail.mud.yahoo.com> References: <4140.98645.qm@web81605.mail.mud.yahoo.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 05 Sep 2007 03:31:08 +0200 Message-Id: <1188955868.4190.1.camel@casa> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.006 tagged_above=0 required=5 tests=BAYES_50=0.001, RCVD_IN_PBL=0.905, RDNS_DYNAMIC=0.1 X-Spam-Level: * X-Archive-Number: 200709/8 X-Sequence-Number: 17430 Il giorno mar, 04/09/2007 alle 07.11 -0700, Chris Baty ha scritto: > Hi Guys, > I'm trying to get Tomcat 5 to access psql. I created a "test' > database and put several drivers in common/lib. I keep getting > > org.postgresql.util.PSQLException: Something unusual has occured to > cause the driver to fail. Please report this exception. [...] Could you please post the complete exception trace? From books@ejurka.com Wed Sep 5 07:11:20 2007 Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 147F49F9DE4 for ; Wed, 5 Sep 2007 04:11:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 56366-01 for ; Wed, 5 Sep 2007 04:11:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 0AD179F9C51 for ; Wed, 5 Sep 2007 04:11:16 -0300 (ADT) Received: (qmail 19105 invoked by uid 1112); 5 Sep 2007 07:11:15 -0000 Date: Wed, 5 Sep 2007 03:11:15 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Chris Baty cc: pgsql-jdbc@postgresql.org Subject: Re: JDBC driver works in ccommand line, not in Tomcat5 In-Reply-To: <4140.98645.qm@web81605.mail.mud.yahoo.com> Message-ID: References: <4140.98645.qm@web81605.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/10 X-Sequence-Number: 17432 On Tue, 4 Sep 2007, Chris Baty wrote: > I'm trying to get Tomcat 5 to access psql. I created a "test' database > and put several drivers in common/lib. I keep getting > > org.postgresql.util.PSQLException: Something unusual has occured to > cause the driver to fail. Please report this exception. This is probably caused by a permission denied error because you are running tomcat with a security policy that does not let you connect to outside resources (such as a database). We should probably do a better job of catching and reporting this error with a helpful suggestion instead of the obscure message and request for a report above. Kris Jurka From books@ejurka.com Wed Sep 5 08:18:38 2007 Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id DC2E89F9D5F for ; Wed, 5 Sep 2007 05:18:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 01688-03 for ; Wed, 5 Sep 2007 05:18:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 6455D9F9D84 for ; Wed, 5 Sep 2007 05:18:31 -0300 (ADT) Received: (qmail 787 invoked by uid 1112); 5 Sep 2007 08:18:30 -0000 Date: Wed, 5 Sep 2007 04:18:30 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Chris Baty cc: pgsql-jdbc@postgresql.org Subject: Re: JDBC driver works in ccommand line, not in Tomcat5 In-Reply-To: Message-ID: References: <4140.98645.qm@web81605.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/11 X-Sequence-Number: 17433 On Wed, 5 Sep 2007, Kris Jurka wrote: > This is probably caused by a permission denied error because you are running > tomcat with a security policy that does not let you connect to outside > resources (such as a database). > > We should probably do a better job of catching and reporting this error with > a helpful suggestion instead of the obscure message and request for a report > above. > Turns out this is pretty easy to do, I'm just not sure what the best text to report to the user is, so far I have: Your security policy has prevented the connection from being attempted. You must grant the connect java.net.SocketPermission to the database server host and port that you wish to connect to. It's a little awkward because it tries to tell you what you need to do, but since there are a number of ways to define a policy for different app servers and configurations, there's no way to be specific enough to solve the problem right here. Anyone have a better suggestions? Kris Jurka From tgl@sss.pgh.pa.us Wed Sep 5 15:07:30 2007 Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 8D00F9FA31B for ; Wed, 5 Sep 2007 12:07:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 58730-01 for ; Wed, 5 Sep 2007 12:07:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 483909F9BFF for ; Wed, 5 Sep 2007 12:07:27 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l85F7O5q013179; Wed, 5 Sep 2007 11:07:24 -0400 (EDT) To: Kris Jurka cc: Chris Baty , pgsql-jdbc@postgresql.org Subject: Re: JDBC driver works in ccommand line, not in Tomcat5 In-reply-to: References: <4140.98645.qm@web81605.mail.mud.yahoo.com> Comments: In-reply-to Kris Jurka message dated "Wed, 05 Sep 2007 04:18:30 -0400" Date: Wed, 05 Sep 2007 11:07:24 -0400 Message-ID: <13178.1189004844@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/23 X-Sequence-Number: 17445 Kris Jurka writes: > Turns out this is pretty easy to do, I'm just not sure what the best text > to report to the user is, so far I have: > Your security policy has prevented the connection from being > attempted. You must grant the connect java.net.SocketPermission > to the database server host and port that you wish to connect to. Can you really tell for sure that it's security policy and not something else? A message as specific as this would be downright counterproductive if it's wrong. FWIW, the backend's style guide would suggest dividing that into an ERROR and a HINT, particularly if the HINT could be mistaken. regards, tom lane From books@ejurka.com Wed Sep 5 17:31:30 2007 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C754D9F9DE0 for ; Wed, 5 Sep 2007 14:31:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 71997-05 for ; Wed, 5 Sep 2007 14:31:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id 8C99F9F9C03 for ; Wed, 5 Sep 2007 14:31:26 -0300 (ADT) Received: (qmail 28957 invoked by uid 1112); 5 Sep 2007 17:31:25 -0000 Date: Wed, 5 Sep 2007 13:31:25 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Tom Lane cc: Chris Baty , pgsql-jdbc@postgresql.org Subject: Re: JDBC driver works in ccommand line, not in Tomcat5 In-Reply-To: <13178.1189004844@sss.pgh.pa.us> Message-ID: References: <4140.98645.qm@web81605.mail.mud.yahoo.com> <13178.1189004844@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/31 X-Sequence-Number: 17453 On Wed, 5 Sep 2007, Tom Lane wrote: > Kris Jurka writes: >> Turns out this is pretty easy to do, I'm just not sure what the best text >> to report to the user is, so far I have: > >> Your security policy has prevented the connection from being >> attempted. You must grant the connect java.net.SocketPermission >> to the database server host and port that you wish to connect to. > > Can you really tell for sure that it's security policy and not something > else? A message as specific as this would be downright > counterproductive if it's wrong. We can be pretty sure by checking if the connection setup failed because of an AccessControlException: http://java.sun.com/j2se/1.5.0/docs/api/java/security/AccessControlException.html > FWIW, the backend's style guide would suggest dividing that into an > ERROR and a HINT, particularly if the HINT could be mistaken. > We don't have separate fields, but I agree it's a little strong, perhaps "You probably need to" instead of "You must". Kris Jurka