views:

566

answers:

1

I want to connect to a mysql database at localhost:3306 using jdbc in a GWT servlet, but when 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 proble, something like this :

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

but I dont know I should apply this change ???
please explain solution for both hosted mode & web mode .
thanks

+1  A: 

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.

Igor Klimer