2

I want to connect to a mysql database at localhost:3306 using jdbc in a GWT servlet, but when I try connecting I get this error:

java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
...

I know that I need to apply a security policy for tomcat to solve this problem, something like this:

grant codeBase "file:${catalina.home}/webapps/-" {
    permission java.net.SocketPermission "192.168.12.81:3306", "connect";
};

But I don't know where should I apply this change? Please provide a solution for both hosted & web mode.

1 Answer 1

2

Make sure you are not using the Google App Engine (I'm assuming here you are using the Google Eclipse Plugin): go to your project's properties -> Google -> App Engine, and make sure it's unchecked.

If this doesn't help, read through the suggestions in this thread.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.