Tuesday, June 12, 2012

Re: Can't get JPA working with Google Cloud SQL

Take a look at the following -- unless its you who posted that in the first place :)


When you configure the JPA factet, GPE creates the persistence.xml file, with the "javax.persistence.jdbc.driver" property set to "com.google.appengine.api.rdbms.AppEngineDriver". I don't see when this could be something else right now.... but still, make sure you use this setting in your persistence.xml



On Wednesday, June 13, 2012 3:20:00 AM UTC+5:30, bill wrote:
The tutorial at https://developers.google.com/eclipse/docs/cloudsql-jpatools is raising more questions for me than providing answers.  Does anyone in this discussion have this working.  I get an error when I try to use Persistence, but the JPA browser in GPE is working correctly, so I think I'm mostly there.  I'm not exactly sure, when I use EclipseLink 2.3, if I should still keep DataNucleus enabled in my Appengine settings.  I'm also not sure if my way of acquiring the EntityManagerFactory is correct.

private static final EntityManagerFactory emfInstance = Persistence.createEntityManagerFactory("MyApp");

The error I get is:

NoClassDefFoundError: java.util.prefs.Preferences is a restricted class. Please see the Google  App Engine developer's guide for more details.
    at com
.google.appengine.tools.development.agent.runtime.Runtime.reject

Anyway, I'd be happy to chat with anyone who has been successful with this.  Thanks

No comments:

Post a Comment