Cannot connect to cloud SQL 2nd generation using hibernate+jpa on GAE

1,460 views
Skip to first unread message

Carl Andin Michel Sanon

unread,
Jul 14, 2016, 10:02:31 AM7/14/16
to Google Cloud SQL discuss
Hi everyone,
                   i read everything in https://cloud.google.com/sql/docs/app-engine-connect also in https://developers.google.com/eclipse/docs/cloudsql-jpatools but i cannot connect to cloud SQL 2nd generation using hibernate+jpa on GAE. Please i want some additional explanation and some example to do it right.

                  i already have a web application running in GAE and connect to cloud sql 1rst generation, look at my persistence file using for the first generation below .
                  Now, what change to do in this persistence file to make it work with cloud sql 2nd generation please?

Best Regards.

<properties>    
            <property name="javax.persistence.jdbc.driver" value="com.google.appengine.api.rdbms.AppEngineDriver" />
            <property name="javax.persistence.jdbc.url" value="jdbc:google:rdbms://myapps-web:apps/db" />               
            <property name="javax.persistence.validation.mode" value="NONE"/>          
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
            <property name="hibernate.connection.pool_size" value="0" />
            <property name="hibernate.connection.useUnicode" value="true"/>
            <property name="hibernate.connection.charSet" value="UTF-8"/>
            <property name="hibernate.bytecode.provider" value="javassist"/>
<!--       <property name="hibernate.bytecode.use_reflection_optimizer" value="true"/> -->
            <property name="hibernate.jdbc.use_streams_for_binary" value="true"/>
            <property name="hibernate.cache.use_query_cache" value="false"/>
            <property name="hibernate.cache.use_second_level_cache" value="false"/>
            <!-- PROD -->
            <property name="hibernate.show_sql" value="false"/>
<!--             <property name="hibernate.format_sql" value="false"/> -->
<!--             <property name="hibernate.generate_statistics" value="false"/> -->
<!--             <property name="hibernate.use_sql_comments" value="false"/> -->
</properties>

Vadim Berezniker

unread,
Jul 15, 2016, 3:09:29 PM7/15/16
to Google Cloud SQL discuss

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/d9032521-6128-46be-917a-786e7369358a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carl Andin Michel Sanon

unread,
Jul 18, 2016, 9:10:11 AM7/18/16
to Google Cloud SQL discuss
hi Vadim Berezniker,
                                i try to do everything in the link you sent, but still not connect. is everything is allright in my persistence.xml. here is my persistence.xml now.
             <properties>  
            <!-- Cloud SQL -->
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://google/SGL?cloudSqlInstance=einstancename:us-east1:instance&amp;socketFactory=com.google.cloud.sql.mysql.SocketFactory;" />
            <property name="javax.persistence.jdbc.user" value="root" />
            <property name="javax.persistence.jdbc.password" value="some_password" />

            <property name="javax.persistence.validation.mode" value="NONE"/>          
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
            <property name="hibernate.connection.pool_size" value="0" />
            <property name="hibernate.connection.useUnicode" value="true"/>
            <property name="hibernate.connection.charSet" value="UTF-8"/>
            <property name="hibernate.bytecode.provider" value="javassist"/>
<!--             <property name="hibernate.bytecode.use_reflection_optimizer" value="true"/> -->
            <property name="hibernate.jdbc.use_streams_for_binary" value="true"/>
            <property name="hibernate.cache.use_query_cache" value="false"/>
            <property name="hibernate.cache.use_second_level_cache" value="false"/>
           
            <!-- DEV -->
            <!-- <property name="hibernate.hbm2ddl.auto" value="update" /> -->

            <property name="hibernate.show_sql" value="false"/>
            <property name="hibernate.format_sql" value="true"/>
            <property name="hibernate.generate_statistics" value="true"/>
            <property name="hibernate.use_sql_comments" value="true"/>

           
            <!-- PROD -->
            <property name="hibernate.show_sql" value="false"/>
<!--             <property name="hibernate.format_sql" value="false"/> -->
<!--             <property name="hibernate.generate_statistics" value="false"/> -->
<!--             <property name="hibernate.use_sql_comments" value="false"/> -->
        </properties>

Vadim Berezniker

unread,
Jul 18, 2016, 12:56:05 PM7/18/16
to Google Cloud SQL discuss
Did you add the library as a dependency in pom.xml (if you're using Maven)?
What error are you getting?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

Carl Andin Michel Sanon

unread,
Jul 18, 2016, 8:52:41 PM7/18/16
to Google Cloud SQL discuss
Thanks for you help Vadim,
                                  i put the jar
               mysql-socket-factory-1.0.1.jar in the lib of my app. when i try to connect, its throw the UnknownAccountException because i use apache shiro


On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Carl Andin Michel Sanon

unread,
Jul 18, 2016, 8:58:46 PM7/18/16
to Google Cloud SQL discuss
Thanks for you help Vadim,
                                  i put the jar
               mysql-socket-factory-1.0.1.jar in the lib of my app. when i try to connect, its throw the UnknownAccountException because i use apache shiro, 


On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Vadim Berezniker

unread,
Jul 19, 2016, 12:16:53 PM7/19/16
to Google Cloud SQL discuss
Can you paste the full exception?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

Carl Andin Michel Sanon

unread,
Jul 19, 2016, 1:03:54 PM7/19/16
to Google Cloud SQL discuss
Hi Vadim, thanx for your support. here is the full exception below:

at com.developer.templatedao.dao.authentication.AuthorizingTemplateRealm.doGetAuthenticationInfo(AuthorizingTemplateRealm.java:70)
at org.apache.shiro.realm.AuthenticatingRealm.getAuthenticationInfo(AuthenticatingRealm.java:568)
at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doSingleRealmAuthentication(ModularRealmAuthenticator.java:180)
at org.apache.shiro.authc.pam.ModularRealmAuthenticator.doAuthenticate(ModularRealmAuthenticator.java:267)
at org.apache.shiro.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:198)
at org.apache.shiro.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:106)
at org.apache.shiro.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:270)
at org.apache.shiro.subject.support.DelegatingSubject.login(DelegatingSubject.java:256)
at com.developer.templatedao.dao.authentication.AuthenticationServlet.doPost(AuthenticationServlet.java:56)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:37)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:50)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:260)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:78)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:148)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:469)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:439)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:446)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:256)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:310)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:302)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:443)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:235)
at java.lang.Thread.run(Thread.java:745)




On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Carl Andin Michel Sanon

unread,
Jul 19, 2016, 1:22:31 PM7/19/16
to Google Cloud SQL discuss
this is a exception i throw when the user from the database is null. the problem is the same username and password work under tomcat in compute engine. but when try to connect uder app engine
the user still null . Here is the code to connect  below

protected AuthenticationInfo doGetAuthenticationInfo(
            AuthenticationToken arg0) {
        UsernamePasswordToken up = (UsernamePasswordToken)arg0;
        String text = (String) up.getPrincipal();
        String username = text.substring(0, text.lastIndexOf(";"));
        String operateur = text.substring(text.lastIndexOf(";")+1, text.length());
        System.out.println("Username : "+username);
        System.out.println("Operateur : "+operateur);
        System.out.println("Username : "+username);
        if(operateur == null || operateur.trim().isEmpty()){
            operateur = "-1";
            //throw new UnknownAccountException("operateur is empty");
        }
        HashedCredentialsMatcher hash = new HashedCredentialsMatcher(Sha256Hash.ALGORITHM_NAME);
        hash.setStoredCredentialsHexEncoded(false);
        hash.setHashIterations(HASH_ITERATION);
        this.setCredentialsMatcher(hash);
        Utilisateur user = UtilisateurManager.findUtilisateurByLogin(entityManager, username, BigInteger.valueOf(Long.parseLong(operateur)));
        if(user == null){
            throw new UnknownAccountException("Incorrect Account");
        }
        String password = user.getPassword();
        String salt = user.getSalt();
        SimpleAuthenticationInfo  info = new SimpleAuthenticationInfo(username, password.toCharArray(),ByteSource.Util.bytes(salt.getBytes()), getName());
        //Authenticated with success
        System.out.println("With Succes....");
        user.setDerniereConnexion(new Date());
        UtilisateurService.setCurrentUser(user);
        return info;

    }


On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Carl Andin Michel Sanon

unread,
Jul 21, 2016, 3:20:11 PM7/21/16
to Google Cloud SQL discuss
Hi Vadim,
               this is the full exception from the server before i throw my own exception.
              
javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Could not open connection
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:273)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)


On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Vadim Berezniker

unread,
Jul 21, 2016, 3:24:23 PM7/21/16
to Google Cloud SQL discuss
Can you double check if there's more to the exception? 
The exception you pasted doesn't include the cause exception which would usually indicate the actual problem.
Without that, it's hard to say what the problem is.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

Carl Andin Michel Sanon

unread,
Jul 21, 2016, 4:00:54 PM7/21/16
to Google Cloud SQL discuss
do you think the problem can exist because im using the jdbc 5.1.39.jar and java7?


On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Carl Andin Michel Sanon

unread,
Jul 21, 2016, 5:14:12 PM7/21/16
to Google Cloud SQL discuss
another thing i see Vadims is even if i change the database instance name with another thats not exist in persitence xml, i still have the same exception, cannot open jdbc connection .see below

<property name="javax.persistence.jdbc.url" value="jdbc:mysql://google/fake_instance_name?cloudSqlInstance=instance:us-east1:project&amp;socketFactory=com.google.cloud.sql.mysql.SocketFactory;" />

On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Vadim Berezniker

unread,
Jul 21, 2016, 6:10:31 PM7/21/16
to Google Cloud SQL discuss
Somewhere in the logs you should see a more detailed error message...

fake_instance_name -> this should be the mysql database name, not the Cloud SQL instance name
cloudSqlInstance -> please double check that this matches the "Instance connection name" shown on the instance overview page in Cloud Console

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

Carl Andin Michel Sanon

unread,
Jul 22, 2016, 9:25:04 AM7/22/16
to Google Cloud SQL discuss
Hi Vadims,
                the mysql instance is correct. let me show you something, in the example  in github the documentation says here is the url of JDBC --->>> jdbc:mysql://google/mydb?cloudSqlInstance=foo:bar:baz&socketFactory=com.google.cloud.sql.mysql.SocketFactory .

Then, when i put my url like this with &amp; after
cloudSqlInstance=e-xxxx:us-east1:exxxx, the web page start, but i cannot connect to database with the exception cannot open the connection database. see below

<property name="javax.persistence.jdbc.url" value="jdbc:mysql://google/SGL?cloudSqlInstance=e-xxxx:us-east1:exxxx&amp;socketFactory=com.google.cloud.sql.mysql.SocketFactory;" />

Now, when i put my url without
&amp; after cloudSqlInstance=e-xxxx:us-east1:exxxx, in the same way in the documentation it cannot _ah start. see below

<property name="javax.persistence.jdbc.url" value="jdbc:mysql://google/SGL?cloudSqlInstance=e-xxxx:us-east1:exxxx&socketFactory=com.google.cloud.sql.mysql.SocketFactory;" />

 its give me exception in the log. the web page cannot lot. see below


<continued from previous message> at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:722) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:410) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:206) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:179) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:136) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:469) at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:439) at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:446) at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:256) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:310) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:302) at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:443) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:235) at java.lang.Thread.run(Thread.java:745) org.datanucleus.api.jpa.PersistenceProviderImpl returned: Error reading the Meta-Data input "The reference to entity "socketFactory" must end with the ';' delimiter. org.xml.sax.SAXParseException; lineNumber: 41; columnNumber: 150; The reference to entity "socketFactory" must end with the ';' delimiter. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:891) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1548) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1320) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:850) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:779) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:642) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:326) at javax.xml.parsers.SAXParser.parse(SAXParser.java:195) at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataStream(MetaDataParser.java:276) at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataURL(MetaDataParser.java:137) at org.datanucleus.metadata.MetaDataUtils.parsePersistenceFiles(MetaDataUtils.java:955) at org.datanucleus.api.jpa.JPAEntityManagerFactory.<init>(JPAEntityManagerFactory.java:342) at org.datanucleus.api.jpa.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:91) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:150) at org.springframework.orm.jpa.LocalEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalEntityManagerFactoryBean.java:92) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$5.run(AbstractAutowireCapableBeanFactory.java:1467) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1465) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:529) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:495) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:656) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:629) at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:147) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:722) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:410) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:206) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:179) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:136) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:469) at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:439) at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:446) at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:256) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:310) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:302) at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:443) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:235) at java.lang.Thread.run(Thread.java:745) " org.datanucleus.exceptions.NucleusException: Error reading the Meta-Data input "The reference to entity "socketFactory" must end with the ';' delimiter. org.xml.sax.SAXParseException; lineNumber: 41; columnNumber: 150; The reference to entity "socketFactory" must end with the ';' delimiter. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) <continued in next message>           

On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Carl Andin Michel Sanon

unread,
Jul 22, 2016, 9:26:18 AM7/22/16
to Google Cloud SQL discuss
Hi Vadims,
                 for faster i can give you acces by team viewer to give me an help.


On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Vadim Berezniker

unread,
Jul 22, 2016, 2:04:58 PM7/22/16
to Google Cloud SQL discuss
& is a special character in XML and must be escaped as &amp;

The error you pasted is because of that: "The reference to entity "socketFactory" must end with the ';' delimiter"

Can you try again using &amp; and paste the full exception?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

Carl Andin Michel Sanon

unread,
Jul 22, 2016, 2:10:00 PM7/22/16
to Google Cloud SQL discuss
Hi Vadims,
                 when i put it, i dont have xml error, but its cannot connect, its throw exception could not open connection when i try to call getResultList(); of Query.
                 can you take a look by team viewer please?


On Thursday, July 14, 2016 at 10:02:31 AM UTC-4, Carl Andin Michel Sanon wrote:

Vadim Berezniker

unread,
Jul 22, 2016, 3:52:38 PM7/22/16
to Google Cloud SQL discuss
Unfortunately, I won't be able to help over teamviewer. 
It's not clear whether this is a Cloud SQL issue or just a general hibernate configuration problem.
I suggest posting a question on Stack Overflow so people that are more familiar with Hibernate can help you.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-d...@googlegroups.com.

Manikandan M

unread,
Feb 7, 2018, 9:15:52 AM2/7/18
to Google Cloud SQL discuss
haii help me also ,,i create my webapplication with java (hibernate framwork)
as the same i create database in google cloud and call like normal ,, normal ,but i think my hibernate reverse engineering configuration is some mistake , please can you help , and i did this project in netbeans so help me

On Thursday, July 14, 2016 at 7:32:31 PM UTC+5:30, Carl Andin Michel Sanon wrote:
Hi everyone,
                   i read ever
 
ything in https://cloud.google.com/sql/docs/app-engine-connect also in https://developers.google.com/eclipse/docs/cloudsql-jpatools but i cannot connect to cloud SQL 2nd generation using hibernate+jpa on GAE. Please i want some additional explanation and some example to do it right.
Reply all
Reply to author
Forward
0 new messages