Monday, December 3, 2012

Re: Fail at MySQL Connector using GAE + GPE

Thanks Rob.
Unfortunately I´ve take so long to realized that!!!


On Thursday, November 29, 2012 10:16:02 PM UTC-2, Rob wrote:
Hi,

You should use the following driver class instead standard MySQL driver:

com.google.appengine.api.rdbms.AppEngineDriver


Hope this helps,

Rob

On Thu, Nov 22, 2012 at 10:07 AM, eduardo conejo <eduard...@gmail.com> wrote:
I´ve sent this email yesterday to GAE discussion group but seems to be more appropriate to use Cloud SQL group. So, I´m copying it here. Any help is very welcome!!!


I´m working on a new system to be deployed on Google App Engine using Google Cloud SQL as database.

My environment is based on Eclipse JUNO (SR1) plus GPE latest available. Using MySQL 5.2 and mysql-connector-java-5.1.22-bin everything on Windows 7 (x64).

I´ve been trying test codes using GAE and GWT mainly based on vanilla GEP auto-generated sample. I may also consider use SmartGWT for fast UI development. At testing time it starts up, the web page gets loaded and I can interact with buttons, etc but the DataBase data never gets populated - it shows the animated fetching icon all the time. Looking at Eclipse console it looks like JDBC connector fails somewhere. Showing the error messages like (full file errors attached):

=== 2012-11-21 23:13:10,192 [01-0] ERROR IDACall - Top-level servlet error: 
java.lang.ExceptionInInitializerError
at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.<clinit>(MysqlDataSource.java:58)
....
....
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)


Searching I found a post in one blog mentioning that there is a issue at java.security.AccessControlException and a potential fix would be like:

In your Java SDK directory you need to remove or modify these 
permission. Modify JDK1.7.0_05\jre\lib\security\java.security file as 
below: 
Change (remove the sun.,): 
FROM 
package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils. 
TO 
package.access=com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils. 
Change (not totally necessary but to avoid other problems): 
FROM 
package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils. 
to 
package.definition=com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils. 
This may leave open other java programs sun.* calls to local access 
but for dev purposes this is the quickest solution without knowing 
specifically what the AppEngine Driver is doing locally and messing 
with app signing and policy files. 
s  

Is this workaround really needed, or I may be missing something else?

Appreciate by any hint on that since I´ve been fighting for about 2 weeks and not progressing.

thanks
Conejo

No comments:

Post a Comment