Re: JDBC driver works in ccommand line, not in Tomcat5

From: Kris Jurka <books(at)ejurka(dot)com>
To: Chris Baty <batymohn(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC driver works in ccommand line, not in Tomcat5
Date: 2007-09-05 08:18:30
Message-ID: Pine.BSO.4.64.0709050411170.27116@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Heikki Linnakangas 2007-09-05 08:35:06 Re: [JDBC] Questión of JDBC
Previous Message Kris Jurka 2007-09-05 07:11:15 Re: JDBC driver works in ccommand line, not in Tomcat5