This is a reminder for me, for Tomcat setting about security violation.

In a simple servlet, if you have some issue with db connection, with this output:

    java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve)

have a look at Tomcat security policy.

To correct this problem, you have to edit /etc/tomcat5/policy.d/

We want to give all contexts not configured by their own grant entry some default permissions in addition to what Tomcat assigns by default:

    grant {
        permission java.net.SocketPermission "localhost:3306","listen,connect,resolve";
        permission java.util.PropertyPermission "*","read";
    };

You may have to replace localhost:3306 with your db host and port.

No TweetBacks yet. (Be the first to Tweet this post)
Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Set your Twitter account name in your settings to use the TwitterBar Section.