Re: Connect Socket problem

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Connect Socket problem
Date: 2003-06-19 08:05:30
Message-ID: 20030619090530.C19922@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


On 19/06/2003 06:44 Rodrigo F. Baroni wrote:
> Hello all,
>
> Please, could someone help me ?!
>
> I did a applet, using a jdbc driver to connect
> with postgres 7.3.1 in a RedHat linux 8.0. When I run
> it from my own machine to connect with the postgres in
> my PC it works fine, but when I run the applet to
> connect to a remote server postgres, the driver
> returns the follow error (got at exception) :
>
> " Something unusual has occured to cause the driver to
> fail. Please report this exception: Exception:
> java.security.AccessControlException: access denied
> (java.net.SocketPermission XXX.XXX.XXX.XXX:5432
> connect, resolve) "
>
> And the Sack Trace follows:
>
> "java.security.AccessControlContext.checkPermission(AccesscontrolContex.java:270)
> .... "
>
>
> Does anybody have any suggestion ?!!

Its the Java security manager. By default, this will only allow an applet
to connect to its web server. You must either run postgres on the same
machine as the web server or edit the jre/lib/security/java.policy file on
your client PC to allow the applet to connect to your postgres machine.
There are ecellent tutorials on applets and security on Sun's Java web
site (http://java.sun.com).

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2003-06-19 09:06:25 Re: forName finds Driver but getConnection doesn't (AGAIN)
Previous Message Rodrigo F. Baroni 2003-06-19 05:44:59 Connect Socket problem