Hello,
Please review the following docs on how to connect to Cloud SQL instance from application running on App Engine Standard environment <https://cloud.google.com/appengine/docs/standard/java/cloud-sql/using-cloud-sql-mysql> or App Engine Flexible environment <https://cloud.google.com/appengine/docs/flexible/java/using-cloud-sql> as they elaborate about the process. This link of GitHub <https://github.com/GoogleCloudPlatform/appengine-cloudsql-native-mysql-hibernate-jpa-demo-java> contains the example program that shows how to use Hibernate on App Engine when connecting to Cloud SQL. Just for your information, please use Google App Engine Standard Environment if you are using for Hibernate version 4.2.0 or earlier and Google App Engine Flexible Environment with later versions of Hibernate in order to avoid the issue described here <https://github.com/GoogleCloudPlatform/appengine-cloudsql-native-mysql-hibernate-jpa-demo-java/issues/2> . Please kindly note that this forum is meant for general discussion of the App Engine platform, not specific technical issues. If you believe that what you've encountered is platform specific issue you can report this by creating an issue in the Issue Tracker <https://cloud.google.com/support/docs/issue-trackers> and Google Cloud Support team member will assist you to resolve your issue. If your issue is not a platform issue but rather a problem with how you've configured your code, although you're not sure what it may be specifically, you should post to StackOverflow <http://www.stackoverflow.com/> and community of developers will assist you. On Wednesday, October 24, 2018 at 3:53:10 PM UTC-4, BestBuy Holidays wrote: > > Below is the exception the program throws when I tried to connect to GCS > from GAE. > > The hibernate settings are > > <?xml version="1.0" encoding="UTF-8"?> > > <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence > http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> > > <persistence-unit name="ContactUsPU"> > > <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> > > <properties> > > <property name="hibernate.dialect" value= > "org.hibernate.dialect.MySQL57InnoDBDialect" /> > > <property name="hibernate.hbm2ddl.auto" value="none" /> > > <property name="hibernate.connection.driver_class" value= > "com.mysql.jdbc.Driver" /> > > <property name="hibernate.connection.url" > > value= > "jdbc:mysql://google/yyyyyy?cloudSqlInstance=bbhwebapp:asia-southeast1:bbh-db&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false" > /> > > <property name="hibernate.connection.username" value="xxxx" /> > > <property name="hibernate.connection.password" value="xxx" /> > > <property name="hibernate.archive.autodetection" value="class" /> > > <property name="hibernate.show_sql" value="true" /> > > <property name="hibernate.format_sql" value="true" /> > > <property name="hibernate.use_sql_comments" value="true" /> > > <property name="hbm2ddl.auto" value="none" /> > > <property name="hibernate.connection.autocommit" value="true"/> > > </properties> > > </persistence-unit> > > </persistence> > > org.hibernate.service.spi.ServiceException: Unable to create requested > service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] > > 1. > 1. at org.hibernate.service.internal. > AbstractServiceRegistryImpl.createService ( > AbstractServiceRegistryImpl.java:271) > 2. at org.hibernate.service.internal. > AbstractServiceRegistryImpl.initializeService ( > AbstractServiceRegistryImpl.java:233) > 3. at org.hibernate.service.internal. > AbstractServiceRegistryImpl.getService ( > AbstractServiceRegistryImpl.java:210) > 4. at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure > (JdbcServicesImpl.java:51) > 5. at org.hibernate.boot.registry.internal. > StandardServiceRegistryImpl.configureService ( > StandardServiceRegistryImpl.java:94) > 6. at org.hibernate.service.internal. > AbstractServiceRegistryImpl.initializeService ( > AbstractServiceRegistryImpl.java:242) > 7. at org.hibernate.service.internal. > AbstractServiceRegistryImpl.getService ( > AbstractServiceRegistryImpl.java:210) > 8. at org.hibernate.boot.model.process.spi. > MetadataBuildingProcess.handleTypes ( > MetadataBuildingProcess.java:352) > 9. at org.hibernate.boot.model.process.spi. > MetadataBuildingProcess.complete (MetadataBuildingProcess.java:111) > 10. at org.hibernate.jpa.boot.internal. > EntityManagerFactoryBuilderImpl.metadata ( > EntityManagerFactoryBuilderImpl.java:861) > 11. at org.hibernate.jpa.boot.internal. > EntityManagerFactoryBuilderImpl.build ( > EntityManagerFactoryBuilderImpl.java:888) > 12. at org.hibernate.jpa. > HibernatePersistenceProvider.createEntityManagerFactory ( > HibernatePersistenceProvider.java:58) > 13. at javax.persistence.Persistence.createEntityManagerFactory ( > Persistence.java:55) > 14. at javax.persistence.Persistence.createEntityManagerFactory ( > Persistence.java:39) > 2. My > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/bbbe0938-95b2-49b4-9d3c-5999bc74d627%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
