Note that there are some explanatory texts on larger screens.

plurals
  1. POGAE google cloud sql JPA local mysql with empty results
    primarykey
    data
    text
    <p>I am trying to get a Development Google App Engine app working with JPA, Google Cloud SQL, and a local MySQL database. I am using the GAE eclipse plugin. I have signed up for a Google cloud SQL instance. Configured the app engine settings on the project to use Google Cloud SQL and put in the connectivity info for the local MySQL database and for the cloud SQL instance. </p> <p>The data nucleus enhancers picks up my 57 classes and I see the log with the classes successfully optimized. I run my application within Eclipse and the dev environment fires up successfully and I can get to my app through the browser.</p> <p>The issue is that the data in the database cannot be retrieved through from the JPA calls. I don't see any errors in the application output. I run through the debugger and the JPA calls run successfully without throwing an exception in my app source code. I get an empty list from retrieval.</p> <p>I am not sure what to do here. I have researched online for quite some time and I can't figure out what I am doing wrong. It is hard to track something down when I don't have an exception or something to use. </p> <p>My guess is that there is something failing but the error could be swallowed or maybe a restriction. I also tried changing the JPA calls by using criteria builder and then using straight up JPQL. Still get the same results. </p> <p>Checked the arguments to the dev server and I see the arguments that are being used from the configuration that I typed in for the local mysql server. Is it possible that the arguments are being ignored somehow? </p> <p>Any help would be appreciated.</p> <p>Persistence.xml - (with only 2 classes for testing)</p> <pre><code>&lt;persistence-unit name="iberis-jpa"&gt; &lt;provider&gt;org.datanucleus.api.jpa.PersistenceProviderImpl&lt;/provider&gt; &lt;class&gt;com.bizznetworxonline.iberis.core.SystemArea&lt;/class&gt; &lt;class&gt;com.bizznetworxonline.iberis.core.SystemUnit&lt;/class&gt; &lt;exclude-unlisted-classes&gt;true&lt;/exclude-unlisted-classes&gt; &lt;properties&gt; &lt;property name="datanucleus.NontransactionalRead" value="true"/&gt; &lt;property name="datanucleus.NontransactionalWrite" value="true"/&gt; &lt;property name="datanucleus.ConnectionURL" value="appengine"/&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; </code></pre> <p>JPQL call:</p> <pre><code>public List&lt;?&gt; findAll(Class&lt;?&gt; entityClass) { EntityManager em = JPA_EMF.get().createEntityManager(); javax.persistence.Query q = em.createQuery("SELECT o FROM " + entityClass.getSimpleName() + " o",entityClass); List&lt;?&gt; results = q.getResultList(); return results; } </code></pre> <p>Output from console:</p> <pre><code>Mar 30, 2013 9:49:06 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml INFO: Successfully processed /home/user/Documents/eclipse-workspace/IberisAdmin/war/WEB-INF/appengine-web.xml Mar 30, 2013 9:49:06 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml INFO: Successfully processed /home/user/Documents/eclipse-workspace/IberisAdmin/war/WEB-INF/web.xml Mar 30, 2013 9:49:06 PM com.google.appengine.tools.development.SystemPropertiesManager setSystemProperties INFO: Overwriting system property key 'java.util.logging.config.file', value '/home/user/.eclipse/org.eclipse.platform_3.7.0_155965261/plugins/com.google.appengine.eclipse.sdkbundle_1.7.6/appengine-java-sdk-1.7.6/config/sdk/logging.properties' with value 'WEB-INF/logging.properties' from '/home/user/Documents/eclipse-workspace/IberisAdmin/war/WEB-INF/appengine-web.xml' Mar 30, 2013 9:49:07 PM com.google.apphosting.utils.jetty.JettyLogger info INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger Mar 30, 2013 9:49:07 PM com.google.apphosting.utils.jetty.JettyLogger info INFO: jetty-6.1.x Mar 30, 2013 9:49:10 PM com.sun.faces.config.ConfigureListener contextInitialized INFO: Initializing Mojarra 2.1.12 ( 20120814-1522) for context '' Mar 30, 2013 9:49:13 PM com.sun.faces.spi.InjectionProviderFactory createInstance INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed. Mar 30, 2013 9:49:21 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent INFO: Running on PrimeFaces 3.5 Mar 30, 2013 9:49:21 PM org.primefaces.extensions.application.PostConstructApplicationEventListener processEvent INFO: Running on PrimeFaces Extensions 0.6.3 Mar 30, 2013 9:49:22 PM com.google.apphosting.utils.jetty.JettyLogger info INFO: Started SelectChannelConnector@127.0.0.1:8888 Mar 30, 2013 9:49:22 PM com.google.appengine.tools.development.AbstractServer startup INFO: Server default is running at http://localhost:8888/ Mar 30, 2013 9:49:22 PM com.google.appengine.tools.development.AbstractServer startup INFO: The admin console is running at http://localhost:8888/_ah/admin Mar 30, 2013 9:49:22 PM com.google.appengine.tools.development.DevAppServerImpl start INFO: Dev App Server is now running Mar 30, 2013 9:49:35 PM com.google.appengine.api.datastore.dev.LocalDatastoreService init INFO: Local Datastore initialized: Type: High Replication Storage: /home/user/Documents/eclipse-workspace/IberisAdmin/war/WEB-INF/appengine-generated/local_db.bin Mar 30, 2013 9:49:35 PM com.google.appengine.api.datastore.dev.LocalDatastoreService load INFO: The backing store, /home/user/Documents/eclipse-workspace/IberisAdmin/war/WEB- INF/appengine-generated/local_db.bin, does not exist. It will be created. Mar 30, 2013 9:49:37 PM com.google.apphosting.utils.jetty.JettyLogger warn </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload