Monday, July 2, 2012

App Engine Cloud SQL project running locally on mySQL dev environment Access Denied

The problem:

When running the sample guestbook application from the Cloud SQL and
GAE Plugin for Eclipse documentation locally from eclipse to a local
mySQL instance I get an exception:
java.security.AccessControlException: access denied
(java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)

I've seen this mentioned in this forum a few times, but no-one has
ever stated that they ever actually got it working.
The only response from google i've seen is "did you read the
documentation". Yes, for the past week

The Setup:

Windows 64-bit Vista
Eclipse 3.7.2
App Engine SDK 1.6.6
JDK 1.6
MySQL 5.5
mysql-connector-java-5.1.20-bin.jar


-VM arguments (generated by GAE Plugin for Eclipse from Google->App
Engine Settings menu)
:
-Drdbms.url=jdbc:mysql://localhost:3306/guestbook?user=root -
Drdbms.driver=com.mysql.jdbc.Driver -Drdbms.server=local -
Drdbms.password="" -Drdbms.user="root" -Drdbms.database="guestbook" -
Ddatastore.default_high_rep_job_policy_unapplied_job_pct=50 -Xmx512m "-
javaagent:C:\Users\john\eclipse\plugins
\com.google.appengine.eclipse.sdkbundle_1.6.6\appengine-java-
sdk-1.6.6\lib\agent\appengine-agent.jar"

Note that the documentation states to add some parameters to the -VM
argument rdbms.url, but since the GAE plugin manages this based on the
Google->App Engine Settings menu, the plug-in strips away anything you
manually add to the rdbms.url argument from the Debug As->Debug
configuration->arguments section.

I can connect to the local instance of mySQL fine when I go into Data
Source Explorer -> MySQL.DevInstance and browse the tables, so I know
mySQL and the Eclipse connection is fine.

It seems the App Engine Plugin is not handling some java VM security
policy rights for its mySQL JDBC connector.

Running the app on a local Dev Google Cloud SQL instance is fine.
When I select local MySQL instance I get the error on server:
java.security.AccessControlException: access denied
(java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)

I also tried a policy file grant permissions for the VM
java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc with no
luck.

ANY help would be appreciated. I've tried everything I could find in
the docs and the net. If anyone has the GAE JDBC connector working
locally on a local mySQL instance using the GAE plugin for Eclipse in
Windows please let me know. I'd at least like to know that it is
working properly and not just theoretically possible!

thank you!

John

No comments:

Post a Comment