AccessControlException while connecting MySQL using JDBC in GWT hosting mode
I want to connect to mysql database on localhost: 3306 using jdbc in GWT servlet, but when I try to connect I get this error:
java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
...
I know that I need to apply tomcat security policy 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 hosting and web mode.
+2
source to share
1 answer
Make sure you are not using the Google the App Engine (I assume you are using the Google Eclipse plugin ): go to your project properties → the Google → the App Engine and ensure that it is not installed.
If that doesn't help, read the suggestions in this thread .
+2
source to share