Java Security Permissions / postgreSQL

495 views
Skip to first unread message

ebe...@gmail.com

unread,
May 18, 2009, 1:57:54 PM5/18/09
to Google Web Toolkit
I've just set up the GWT today as plugin to Eclipse (3.4.1) after
installing PostgreSQL (8.3). I'm pretty new to these applications, and
have been having minor snag after minor snag that's resulting in a
rather large hole in my shirt.

Right now I have a problem that isn't GWT's fault, per se, but I don't
know where to look in the Eclipse project to find the appropriate
permissions file.

Long story short: I need to add the permissions for
java.net.SocketPermission to localhost on port 5432, and I think this
because I get the following error when trying to connect to my
database after loading the JDBC driver for postgresql:

"org.postgresql.util.PSQLException: Your security policy has prevented
the connection from being attempted. You probably need to grant the
connect java.net.SocketPermission to the database server host and port
that you wish to connect to."

I've tried adding such a security policy to all of my JRE's /jre/lib/
security/java.policy files, but no luck - still get the error. Am I
creating the policy wrong in those files, or is it that when the GWT
debugs/compiles it obeys a different policy file?

Please let me know, thanks in advance, and please pardon me if this
has already been covered... but I've been googling around for an hour
or so, and the only answers I've found pertain to TomCat servers,
which I'm pretty sure I'm not using. Thanks again :)
Message has been deleted

Adligo

unread,
May 19, 2009, 7:35:18 PM5/19/09
to Google Web Toolkit

Hi,

This sounds like it is postgres specific, did you add the allowed
ip address in your postgres configuration files to allow the postgress
(postmaster server), and are you running the postmaster (internet
damen for postgress) ?
You probably want to try something like
http://squirrel-sql.sourceforge.net
first before worring about attaching a new application, just to see if
postgres is set up and running correctly.

Cheers,
Scott
www.adligo.com
All my demos run on postgress :)

SmartGWT_D

unread,
May 28, 2009, 5:01:42 AM5/28/09
to Google Web Toolkit
Hi, did you find a solution for your problem, because I've the same.
And I yould like to add some information : I can access the DataBase
with my IP adress so thats not the cause of my problem.


On May 18, 7:57 pm, "ebe...@gmail.com" <ebe...@gmail.com> wrote:
> I've just set up the GWT today as plugin to Eclipse (3.4.1) after
> installing PostgreSQL (8.3). I'm pretty new to these applications, and
> have been having minor snag after minor snag that's resulting in a
> rather large hole in my shirt.
>
> Right now I have a problem that isn't GWT's fault, per se, but I don't
> know where to look in the Eclipse project to find the appropriate
> permissions file.
>
> Long story short: Ineedto add the permissions forjava.net.SocketPermissionto localhost onport5432, and I think this
> because I get the following error when trying toconnectto mydatabaseafter loading the JDBC driver for postgresql:
>
> "org.postgresql.util.PSQLException:Yoursecuritypolicyhasprevented
> theconnectionfrombeingattempted. Youprobablyneedtogranttheconnectjava.net.SocketPermissionto thedatabaseserverhostandport
> thatyouwishtoconnectto."
>
> I've tried adding such asecuritypolicyto all of my JRE's /jre/lib/security/java.policyfiles, but no luck - still get the error. Am I
> creating thepolicywrong in those files, or is it that when the GWT
> debugs/compiles it obeys a differentpolicyfile?
>
> Please let me know, thanks in advance, and please pardon me if thishasalready been covered... but I've been googling around for an hour

Jason Essington

unread,
May 28, 2009, 12:49:17 PM5/28/09
to Google-We...@googlegroups.com
If you are using the Google Eclipse Plugin, is your project marked as
an appengine project?
If so, you'll want to unselect that option to use a regular database.

-jason

Kaabi Nabil

unread,
May 28, 2009, 2:31:49 PM5/28/09
to Google-We...@googlegroups.com
Thanks a lot.

2009/5/28 Jason Essington <jason.e...@gmail.com>

Enea

unread,
Jun 7, 2009, 7:09:49 PM6/7/09
to Google Web Toolkit
Thanks a lot!
Project->Properties->Google->AppEngine-> Unmark "Use Google app
Engine"

I had exactly the same "difficulty" with gwt+eclipse+postgre :)


-Enea

Rahul Mukhedkar

unread,
Jul 9, 2009, 10:57:09 AM7/9/09
to Google Web Toolkit
thanks a lot
i having the same problem
thanks a lot Enea for showing the exact path where to unmark
Reply all
Reply to author
Forward
0 new messages