java.policy most of the time!
Posted by: Andrei Todea
Date: April 09, 2008 06:01PM

Most of the time this error is thrown by java.policy.
Make sure you have the wright to access whatever you need.
You would have in the StackTrace something related to java.net.SocketPermission.
If you don't see anything related to java.net.SocketPermission in the StackTrace then maybe you shouldn't mess with the policies :).

Here is an example for MySQL at localhost:

grant { permission java.net.SocketPermission "localhost:3306", "connect, resolve"; };

This code should be added to "java.policy" or, sometimes in specialized places.
It used to work on Java 1.5 for me but on Java 1.6 I had to place it in Tomcat's policy, at "10admin.policy"

Options: ReplyQuote


Subject
Written By
Posted
June 09, 2006 04:42AM
August 24, 2006 05:27PM
July 15, 2007 04:27AM
java.policy most of the time!
April 09, 2008 06:01PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.