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