vmware-archive / pcf-workspace-devops

PCF Workspace for DevOps Workshop
https://github.com/cf-platform-eng/spring-boot-cities
BSD 2-Clause "Simplified" License
9 stars 48 forks source link

Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument #1

Open roninby opened 7 years ago

roninby commented 7 years ago

Hello,

Is the cities-service still available for deploying?

When trying to deploy cities-service into a local Cloud Foundry environment, I met a problem on spring bean as below:

[gcps@ansiblehost cities-service]$ bosh -e bosh-1 deployments
bash: bosh: command not found...
[gcps@ansiblehost cities-service]$ bosh2 -e bosh-1 deployments
Using environment '10.10.0.6' as client 'admin'

Name     Release(s)                    Stemcell(s)                                       Team(s)  Cloud Config
cf-1     binary-buildpack/1.0.13       bosh-vsphere-esxi-ubuntu-trusty-go_agent/3421.11  -        latest
         capi/1.35.0
         cf-mysql/36
         cf-networking/1.2.0
         cf-smoke-tests/36
         cflinuxfs2/1.138.0
         consul/171
         diego/1.22.0
         dotnet-core-buildpack/1.0.22
         etcd/117
         garden-runc/1.9.0
         go-buildpack/1.8.5
         java-buildpack/3.18
         loggregator/91
         nats/21
         nodejs-buildpack/1.6.2
         php-buildpack/4.3.38
         python-buildpack/1.5.20
         routing/0.159.0
         ruby-buildpack/1.6.44
         staticfile-buildpack/1.4.11
         statsd-injector/1.0.28
         uaa/41
mysql-1  cf-mysql/36                   bosh-vsphere-esxi-ubuntu-trusty-go_agent/3312.17  -        latest
         routing/0.154.0

2 deployments

Succeeded
[gcps@ansiblehost cities-service]$ cf apps
Getting apps in org gcps / space gcps-dev as admin...
OK

name             requested state   instances   memory   disk   urls
cities-service   started           0/1         1G       1G     cities-service.cf.gcps.lab
spring-music     started           1/1         512M     1G     spring-music-insulting-minibus.cf.gcps.lab
[gcps@ansiblehost cities-service]$ cf services
Getting services in org gcps / space gcps-dev as admin...
OK

name        service   plan   bound apps       last operation
cities-db   p-mysql   10mb   cities-service   create succeeded

[gcps@ansiblehost cities-service]$ cat manifest.service
---
applications:
- name: cities-service
  memory: 1G
  instances: 1
  path: build/libs/cities-service.jar
  buildpack: https://github.com/cloudfoundry/java-buildpack.git
  timeout: 180
  services: [ cities-db ]
  env:
    SPRING_PROFILES_ACTIVE: cloud
[gcps@ansiblehost cities-service]$ cf logs cities-service --recent
Retrieving logs for app cities-service in org gcps / space gcps-dev as admin...

   2017-07-27T13:46:04.40+0800 [API/0] OUT Process has crashed with type: "web"
   2017-07-27T13:46:04.41+0800 [API/0] OUT App instance exited with guid 1b510560-ee41-4721-8259-abd4d84df9b9 payload: {"instance"=>"c4b2ac99-ec28-4184-6992-13b1", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Exited with status 1; cancelled; cancelled", "crash_count"=>3, "crash_timestamp"=>1501134699772907404, "version"=>"d5ad1032-7167-434a-80b1-8eef8ebe4bc1"}
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositories' defined in class org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.repository.support.Repositories org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.repositories()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityRepository': Cannot create inner bean '(inner bean)#39db33e6' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#39db33e6': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1095)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:990)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.repositories(<generated>)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.getProjections(RepositoryRestMvcConfiguration.java:621)
   2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.config(RepositoryRestMvcConfiguration.java:224)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.CGLIB$config$40(<generated>)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172$$FastClassBySpringCGLIB$$90c6a9f0.invoke(<generated>)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.config(<generated>)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at java.lang.reflect.Method.invoke(Method.java:498)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     ... 92 more
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.repository.support.Repositories org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.repositories()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityRepository': Cannot create inner bean '(inner bean)#39db33e6' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#39db33e6': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     ... 114 more
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityRepository': Cannot create inner bean '(inner bean)#39db33e6' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#39db33e6': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:290)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:129)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1457)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1198)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
   2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.repository.support.Repositories.populateRepositoryFactoryInformation(Repositories.java:87)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.repository.support.Repositories.<init>(Repositories.java:78)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.repositories(RepositoryRestMvcConfiguration.java:146)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.CGLIB$repositories$1(<generated>)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172$$FastClassBySpringCGLIB$$90c6a9f0.invoke(<generated>)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.repositories(<generated>)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at java.lang.reflect.Method.invoke(Method.java:498)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     ... 115 more
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#39db33e6': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:632)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:442)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1095)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:990)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:276)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     ... 137 more
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1554)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR     ... 145 more
   2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:104)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:71)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:205)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:336)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1613)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1550)
   2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR     ... 152 more
   2017-07-27T13:47:58.92+0800 [APP/PROC/WEB/0] OUT Exit status 1
   2017-07-27T13:47:58.92+0800 [CELL/0] OUT Exit status 0
   2017-07-27T13:47:58.94+0800 [CELL/0] OUT Destroying container
   2017-07-27T13:48:00.96+0800 [CELL/0] OUT Successfully destroyed container

Any advice on what I missed? Thanks in advance.

pivotal-bin-ju commented 7 years ago

Hi,

May I see some of your source code? such as something related to ' cityRepository'?

On Thu, Jul 27, 2017 at 2:08 PM, roninby notifications@github.com wrote:

Hello,

Is the cities-service still available for deploying?

When trying to deploy cities-service into a local Cloud Foundry environment, I met a problem on spring bean as below:

[gcps@ansiblehost cities-service]$ bosh -e bosh-1 deployments bash: bosh: command not found... [gcps@ansiblehost cities-service]$ bosh2 -e bosh-1 deployments Using environment '10.10.0.6' as client 'admin'

Name Release(s) Stemcell(s) Team(s) Cloud Config cf-1 binary-buildpack/1.0.13 bosh-vsphere-esxi-ubuntu-trusty-go_agent/3421.11 - latest capi/1.35.0 cf-mysql/36 cf-networking/1.2.0 cf-smoke-tests/36 cflinuxfs2/1.138.0 consul/171 diego/1.22.0 dotnet-core-buildpack/1.0.22 etcd/117 garden-runc/1.9.0 go-buildpack/1.8.5 java-buildpack/3.18 loggregator/91 nats/21 nodejs-buildpack/1.6.2 php-buildpack/4.3.38 python-buildpack/1.5.20 routing/0.159.0 ruby-buildpack/1.6.44 staticfile-buildpack/1.4.11 statsd-injector/1.0.28 uaa/41 mysql-1 cf-mysql/36 bosh-vsphere-esxi-ubuntu-trusty-go_agent/3312.17 - latest routing/0.154.0

2 deployments

Succeeded [gcps@ansiblehost cities-service]$ cf apps Getting apps in org gcps / space gcps-dev as admin... OK

name requested state instances memory disk urls cities-service started 0/1 1G 1G cities-service.cf.gcps.lab spring-music started 1/1 512M 1G spring-music-insulting-minibus.cf.gcps.lab [gcps@ansiblehost cities-service]$ cf services Getting services in org gcps / space gcps-dev as admin... OK

name service plan bound apps last operation cities-db p-mysql 10mb cities-service create succeeded

[gcps@ansiblehost cities-service]$ cat manifest.service

applications:

[gcps@ansiblehost cities-service]$ cf logs cities-service --recent Retrieving logs for app cities-service in org gcps / space gcps-dev as admin...

2017-07-27T13:46:04.40+0800 [API/0] OUT Process has crashed with type: "web" 2017-07-27T13:46:04.41+0800 [API/0] OUT App instance exited with guid 1b510560-ee41-4721-8259-abd4d84df9b9 payload: {"instance"=>"c4b2ac99-ec28-4184-6992-13b1", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Exited with status 1; cancelled; cancelled", "crash_count"=>3, "crash_timestamp"=>1501134699772907404, "version"=>"d5ad1032-7167-434a-80b1-8eef8ebe4bc1"} 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositories' defined in class org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.repository.support.Repositories org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.repositories()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityRepository': Cannot create inner bean '(inner bean)#39db33e6' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#39db33e6': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1095) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:990) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.repositories() 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.getProjections(RepositoryRestMvcConfiguration.java:621) 2017-07-27T13:47:58.81+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.config(RepositoryRestMvcConfiguration.java:224) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.CGLIB$config$40() 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172$$FastClassBySpringCGLIB$$90c6a9f0.invoke() 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.config() 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at java.lang.reflect.Method.invoke(Method.java:498) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR ... 92 more 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.repository.support.Repositories org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.repositories()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityRepository': Cannot create inner bean '(inner bean)#39db33e6' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#39db33e6': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR ... 114 more 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityRepository': Cannot create inner bean '(inner bean)#39db33e6' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#39db33e6': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:290) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:129) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1457) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1198) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) 2017-07-27T13:47:58.82+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.repository.support.Repositories.populateRepositoryFactoryInformation(Repositories.java:87) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.repository.support.Repositories.(Repositories.java:78) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.repositories(RepositoryRestMvcConfiguration.java:146) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.CGLIB$repositories$1() 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172$$FastClassBySpringCGLIB$$90c6a9f0.invoke() 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$767ac172.repositories() 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at java.lang.reflect.Method.invoke(Method.java:498) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR ... 115 more 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#39db33e6': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:336) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:632) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:442) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1095) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:990) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:276) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR ... 137 more 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1554) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR ... 145 more 2017-07-27T13:47:58.83+0800 [APP/PROC/WEB/0] ERR Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:104) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:71) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:205) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:336) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1613) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1550) 2017-07-27T13:47:58.84+0800 [APP/PROC/WEB/0] ERR ... 152 more 2017-07-27T13:47:58.92+0800 [APP/PROC/WEB/0] OUT Exit status 1 2017-07-27T13:47:58.92+0800 [CELL/0] OUT Exit status 0 2017-07-27T13:47:58.94+0800 [CELL/0] OUT Destroying container 2017-07-27T13:48:00.96+0800 [CELL/0] OUT Successfully destroyed container

Any advice on what I missed? Thanks in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/ASo6M7wAK3FYM4WXaSuTrhm67IS6wVnGks5sSClNgaJpZM4Ok1Mr .

-- 鞠国滨 Bin Ju +86 13662231177

roninby commented 7 years ago

I just cloned the source code from https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/tree/master/cities-service. Nothing is changed.

cities-service can locally run with java -jar build/libs/cities-service.jar, but cf push -f manifest.service always fails even the service info of the mysql db is removed from manifest.service.

I also confirmed the jdbc connection to the mysql proxy is OK with the following of java code:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class MySQLConnectExample {
    public static void main(String[] args) {

        //    creates three different Connection objects
        Connection conn1 = null;

        try {
            //Class.forName("com.mysql.jdbc.Driver");
            // connect way #1
            String url1 = "jdbc:mysql://10.11.0.30:3306/cf_b211f1c6_1705_481f_ae9c_8b8d1a5e2ffb?user=tH7EGPkFnfQeXsVJ\u0026password=Nr0enIoSQTNxMuJj";

            conn1 = DriverManager.getConnection(url1);

            if (conn1 != null) {
                System.out.println("Connected to the database");
            }
        } catch (SQLException ex) {
            System.out.println("An error occurred. Maybe user/password is invalid");
            ex.printStackTrace();
        }
    }
}

[gcps@ansiblehost jdbc]$ java MySQLConnectExample
Connected to the database

Looks like something has to be adjusted in the source code before cf push ?

roninby commented 7 years ago

According to the instruction of Customizing the DataSource , I've changed the src/main/java/com/example/cities/config/CloudDataSourceConfig.java as below, but it still failed with the same errors.

package com.example.cities.config;

import org.springframework.cloud.config.java.AbstractCloudConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import org.springframework.cloud.service.PooledServiceConnectorConfig;
import org.springframework.cloud.service.relational.DataSourceConfig;

import javax.sql.DataSource;

@Configuration
@Profile("cloud")
public class CloudDataSourceConfig extends AbstractCloudConfig {
    @Bean
    public DataSource dataSource() {
    PooledServiceConnectorConfig.PoolConfig poolConfig =
            new PooledServiceConnectorConfig.PoolConfig(20, 200);

    DataSourceConfig.ConnectionConfig connectionConfig =
            new DataSourceConfig.ConnectionConfig("characterEncoding=UTF-8");
    DataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, connectionConfig);

        return connectionFactory().dataSource("cities-db", serviceConfig);
    }

}
pivotal-bin-ju commented 7 years ago

Hi,

Can you comment out what you've changed to see if we still have the same problem?

On Fri, Jul 28, 2017 at 7:52 AM, roninby notifications@github.com wrote:

According to the instruction of Customizing the DataSource https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/blob/master/cities-service/demo-script.adoc#customizing-the-datasource , I've changed the src/main/java/com/example/cities/config/ CloudDataSourceConfig.java as below, but it still failed with the same errors.

package com.example.cities.config;

import org.springframework.cloud.config.java.AbstractCloudConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile;

import org.springframework.cloud.service.PooledServiceConnectorConfig; import org.springframework.cloud.service.relational.DataSourceConfig;

import javax.sql.DataSource;

@Configuration @Profile("cloud") public class CloudDataSourceConfig extends AbstractCloudConfig { @Bean public DataSource dataSource() { PooledServiceConnectorConfig.PoolConfig poolConfig = new PooledServiceConnectorConfig.PoolConfig(20, 200);

DataSourceConfig.ConnectionConfig connectionConfig =
        new DataSourceConfig.ConnectionConfig("characterEncoding=UTF-8");
DataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, connectionConfig);

    return connectionFactory().dataSource("cities-db", serviceConfig);
}

}

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/issues/1#issuecomment-318518020, or mute the thread https://github.com/notifications/unsubscribe-auth/ASo6M1RpnoPD0gpY7nkXNyNMiMgZA3GIks5sSSLJgaJpZM4Ok1Mr .

-- 鞠国滨 Bin Ju +86 13662231177

roninby commented 7 years ago

@pivotal-bin-ju

What I'm trying to do is following a cf app demo on a local CF environment.

Firstly, I did not change any code, but cf push failed.

Then, I tried to follow the instructions to make some changes just in src/main/java/com/example/cities/config/CloudDataSourceConfig.java as below, the lines in Bold are new added:

package com.example.cities.config;

import org.springframework.cloud.config.java.AbstractCloudConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile;

import org.springframework.cloud.service.PooledServiceConnectorConfig; import org.springframework.cloud.service.relational.DataSourceConfig;

import javax.sql.DataSource;

@Configuration @Profile("cloud") public class CloudDataSourceConfig extends AbstractCloudConfig { @Bean public DataSource dataSource() { PooledServiceConnectorConfig.PoolConfig poolConfig = new PooledServiceConnectorConfig.PoolConfig(20, 200); DataSourceConfig.ConnectionConfig connectionConfig = new DataSourceConfig.ConnectionConfig("characterEncoding=UTF-8"); DataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, connectionConfig); return connectionFactory().dataSource("cities-db", serviceConfig); }

}

The original code is located at here for your references.

pivotal-bin-ju commented 7 years ago

Hi,

Have you tried this:

$ gradle assemble $ cf create-service p-mysql 100mb-dev cities-db $ cf push --random-route --no-start

cf bs 100mb-dev

cf restage

On Fri, Jul 28, 2017 at 11:12 AM, roninby notifications@github.com wrote:

@pivotal-bin-ju https://github.com/pivotal-bin-ju

What I'm trying to do is following a cf app demo http://pcf-ford-workshop.cfapps.io/2016/03/15/lab--build-and-deploy-apps-on-pcf/ on a local CF environment.

Firstly, I did not change any code, but cf push failed.

Then, I tried to follow the instructions https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/blob/master/cities-service/demo-script.adoc#customizing-the-datasource to make some changes just in src/main/java/com/example/cities/config/ CloudDataSourceConfig.java as below, the lines in Bold are new added:

package com.example.cities.config;

import org.springframework.cloud.config.java.AbstractCloudConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile;

import org.springframework.cloud.service.PooledServiceConnectorConfig; import org.springframework.cloud.service.relational.DataSourceConfig;

import javax.sql.DataSource;

@configuration https://github.com/configuration @Profile https://github.com/profile("cloud") public class CloudDataSourceConfig extends AbstractCloudConfig { @bean https://github.com/bean

public DataSource dataSource() { PooledServiceConnectorConfig.PoolConfig poolConfig = new PooledServiceConnectorConfig.PoolConfig(20, 200); DataSourceConfig.ConnectionConfig connectionConfig = new DataSourceConfig.ConnectionConfig("characterEncoding=UTF-8"); DataSourceConfig serviceConfig = new DataSourceConfig(poolConfig, connectionConfig); return connectionFactory().dataSource("cities-db", serviceConfig); }

}

The original code is located at here https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/blob/master/cities-service/src/main/java/com/example/cities/config/CloudDataSourceConfig.java for your references.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/issues/1#issuecomment-318545359, or mute the thread https://github.com/notifications/unsubscribe-auth/ASo6M2ztmZx9SAb7vuP-kuEBY0nwSH5_ks5sSVGvgaJpZM4Ok1Mr .

-- 鞠国滨 Bin Ju +86 13662231177

roninby commented 7 years ago

Hello,

I tried again from the very beginning as you suggested, but cf push still failed.

$ cf delete cities-service $ cf delete-service cities-db

Restore the changed code back to the original.

$ cd ~work/apps/pcf-workspace-devops/ $ ./gradlew clean assemble

[gcps@ansiblehost pcf-workspace-devops]$ ./gradlew clean assemble
:cities-client:clean
:cities-hello:clean
:cities-service:clean
:cities-ui:clean
:cities-client:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:cities-client:processResources
:cities-client:classes
:cities-client:jar
:cities-client:assemble
:cities-hello:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:cities-hello:processResources
:cities-hello:classes
:cities-hello:jar
:cities-hello:bootRepackage
:cities-hello:assemble
:cities-service:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:cities-service:processResources
:cities-service:classes
:cities-service:jar
:cities-service:bootRepackage
:cities-service:assemble
:cities-ui:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:cities-ui:processResources
:cities-ui:classes
:cities-ui:jar
:cities-ui:bootRepackage
:cities-ui:assemble

BUILD SUCCESSFUL

$ cd cities-service/ $ cat manifest.service ###Actually the manifest is not used this time.

---
applications:
- name: cities-service
  memory: 1G
  instances: 1
  path: build/libs/cities-service.jar
  buildpack: https://github.com/cloudfoundry/java-buildpack.git
  timeout: 180
  services: [ cities-db ]
  env:
    SPRING_PROFILES_ACTIVE: cloud

$ cf create-service p-mysql 20mb cities-db $ cf push cities-service -i 1 -m 512M -p build/libs/cities-service.jar --random-route --no-start $ cf bind-service cities-service cities-db $ cf restart cities-service ### Cannot run cf restage cities-service

[gcps@ansiblehost cities-service]$ cf restage cities-service
Restaging app cities-service in org gcps / space gcps-dev as admin...
Failed to watch staging of app cities-service in org gcps / space gcps-dev as admin...

[gcps@ansiblehost cities-service]$ cf restart cities-service

Starting app cities-service in org gcps / space gcps-dev as admin...
Downloading staticfile_buildpack...
Downloading binary_buildpack...
Downloading dotnet_core_buildpack...
Downloading java_buildpack...
Downloading go_buildpack...
Downloaded java_buildpack
Downloaded binary_buildpack
Downloading nodejs_buildpack...
Downloaded staticfile_buildpack
Downloading python_buildpack...
Downloading php_buildpack...
Downloaded dotnet_core_buildpack
Downloading ruby_buildpack...
Downloaded go_buildpack
Downloaded php_buildpack
Downloaded ruby_buildpack
Downloaded nodejs_buildpack
Downloaded python_buildpack
Creating container
Successfully created container
Downloading app package...
Downloaded app package (24.1M)
Staging...
-----> Java Buildpack Version: v3.18 | https://github.com/cloudfoundry/java-buildpack.git#841ecb2
-----> Downloading Open Jdk JRE 1.8.0_141 from https://java-buildpack.cloudfoundry.org/openjdk/trusty/x86_64/openjdk-1.8.0_141.tar.gz (5m 9s)
       Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.6s)
-----> Downloading Open JDK Like Memory Calculator 2.0.2_RELEASE from https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-2.0.2_RELEASE.tar.gz (2.4s)
       Memory Settings: -Xmx681574K -XX:MaxMetaspaceSize=104857K -Xss349K -Xms681574K -XX:MetaspaceSize=104857K
-----> Downloading Container Security Provider 1.7.0_RELEASE from https://java-buildpack.cloudfoundry.org/container-security-provider/container-security-provider-1.7.0_RELEASE.jar (2.2s)
-----> Downloading Spring Auto Reconfiguration 1.12.0_RELEASE from https://java-buildpack.cloudfoundry.org/auto-reconfiguration/auto-reconfiguration-1.12.0_RELEASE.jar (2.5s)
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading build artifacts cache...
Uploading droplet...
Uploaded build artifacts cache (45.7M)
Uploaded droplet (70.1M)
Uploading complete
Destroying container
Successfully destroyed container

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Start unsuccessful

TIP: use 'cf logs cities-service --recent' for more information

[gcps@ansiblehost cities-service]$ cf logs cities-service --recent
Retrieving logs for app cities-service in org gcps / space gcps-dev as admin...

   2017-07-28T16:03:26.63+0800 [API/0] OUT Process has crashed with type: "web"
   2017-07-28T16:03:26.64+0800 [API/0] OUT App instance exited with guid 6475077b-57c9-47ac-be16-3f363a17f259 payload: {"instance"=>"eb07cf1f-947b-4c66-68e7-ea97", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Exited with status 1; cancelled; cancelled", "crash_count"=>4, "crash_timestamp"=>1501229342007707380, "version"=>"598f8269-c51d-4a10-9dd9-9e931c061890"}
   2017-07-28T16:05:21.77+0800 [APP/PROC/WEB/0] ERR     at java.lang.reflect.Method.invoke(Method.java:498)
   2017-07-28T16:05:21.77+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.rest.core.config.RepositoryRestConfiguration org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.config()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositories' defined in class org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.repository.support.Repositories org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.repositories()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityRepository': Cannot create inner bean '(inner bean)#e355e62' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#e355e62': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
   2017-07-28T16:05:21.77+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188)
   2017-07-28T16:05:21.78+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:990)
   2017-07-28T16:05:21.78+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
   2017-07-28T16:05:21.78+0800 [APP/PROC/WEB/0] ERR     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
...
...
pivotal-bin-ju commented 7 years ago

Hi,

I could run the demo successfully on PCFDEV .without any change, but the manifest.

here is the manifest.service:

1 ---

2 applications:

3 - name: instructor-cities-service

4 memory: 512M

5 instances: 1

6 path: build/libs/cities-service.jar

7 buildpack: java_buildpack

8 timeout: 180

9 services: [ mysql ]

10 env:

11 SPRING_PROFILES_ACTIVE: cloud I doubt your problem is caused by the buildpack. You're using a newer or older version.

~ [image: Inline image 1]

On Fri, Jul 28, 2017 at 4:15 PM, roninby notifications@github.com wrote:

Hello,

I tried again from the very beginning as you suggested, but cf push still failed.

$ cf delete cities-service $ cf delete-service cities-db

Restore the changed code back to the original.

$ cd ~work/apps/pcf-workspace-devops/ $ ./gradlew clean assemble

[gcps@ansiblehost pcf-workspace-devops]$ ./gradlew clean assemble :cities-client:clean :cities-hello:clean :cities-service:clean :cities-ui:clean :cities-client:compileJava warning: [options] bootstrap class path not set in conjunction with -source 1.7 1 warning :cities-client:processResources :cities-client:classes :cities-client:jar :cities-client:assemble :cities-hello:compileJava warning: [options] bootstrap class path not set in conjunction with -source 1.7 1 warning :cities-hello:processResources :cities-hello:classes :cities-hello:jar :cities-hello:bootRepackage :cities-hello:assemble :cities-service:compileJava warning: [options] bootstrap class path not set in conjunction with -source 1.7 1 warning :cities-service:processResources :cities-service:classes :cities-service:jar :cities-service:bootRepackage :cities-service:assemble :cities-ui:compileJava warning: [options] bootstrap class path not set in conjunction with -source 1.7 1 warning :cities-ui:processResources :cities-ui:classes :cities-ui:jar :cities-ui:bootRepackage :cities-ui:assemble

BUILD SUCCESSFUL

$ cd cities-service/ $ cat manifest.service ###Actually the manifest is not used this time.


applications:

$ cf create-service p-mysql 20mb cities-db $ cf push cities-service -i 1 -m 512M -p build/libs/cities-service.jar --random-route --no-start $ cf bind-service cities-service cities-db $ cf restart cities-service ### Cannot run cf restage cities-service

[gcps@ansiblehost cities-service]$ cf restage cities-service Restaging app cities-service in org gcps / space gcps-dev as admin... Failed to watch staging of app cities-service in org gcps / space gcps-dev as admin...

[gcps@ansiblehost cities-service]$ cf restart cities-service

Starting app cities-service in org gcps / space gcps-dev as admin... Downloading staticfile_buildpack... Downloading binary_buildpack... Downloading dotnet_core_buildpack... Downloading java_buildpack... Downloading go_buildpack... Downloaded java_buildpack Downloaded binary_buildpack Downloading nodejs_buildpack... Downloaded staticfile_buildpack Downloading python_buildpack... Downloading php_buildpack... Downloaded dotnet_core_buildpack Downloading ruby_buildpack... Downloaded go_buildpack Downloaded php_buildpack Downloaded ruby_buildpack Downloaded nodejs_buildpack Downloaded python_buildpack Creating container Successfully created container Downloading app package... Downloaded app package (24.1M) Staging... -----> Java Buildpack Version: v3.18 | https://github.com/cloudfoundry/java-buildpack.git#841ecb2 -----> Downloading Open Jdk JRE 1.8.0_141 from https://java-buildpack.cloudfoundry.org/openjdk/trusty/x86_64/openjdk-1.8.0_141.tar.gz (5m 9s) Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.6s) -----> Downloading Open JDK Like Memory Calculator 2.0.2_RELEASE from https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-2.0.2_RELEASE.tar.gz (2.4s) Memory Settings: -Xmx681574K -XX:MaxMetaspaceSize=104857K -Xss349K -Xms681574K -XX:MetaspaceSize=104857K -----> Downloading Container Security Provider 1.7.0_RELEASE from https://java-buildpack.cloudfoundry.org/container-security-provider/container-security-provider-1.7.0_RELEASE.jar (2.2s) -----> Downloading Spring Auto Reconfiguration 1.12.0_RELEASE from https://java-buildpack.cloudfoundry.org/auto-reconfiguration/auto-reconfiguration-1.12.0_RELEASE.jar (2.5s) Exit status 0 Staging complete Uploading droplet, build artifacts cache... Uploading build artifacts cache... Uploading droplet... Uploaded build artifacts cache (45.7M) Uploaded droplet (70.1M) Uploading complete Destroying container Successfully destroyed container

0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 crashed FAILED Start unsuccessful

TIP: use 'cf logs cities-service --recent' for more information

[gcps@ansiblehost cities-service]$ cf logs cities-service --recent Retrieving logs for app cities-service in org gcps / space gcps-dev as admin...

2017-07-28T16:03:26.63+0800 [API/0] OUT Process has crashed with type: "web" 2017-07-28T16:03:26.64+0800 [API/0] OUT App instance exited with guid 6475077b-57c9-47ac-be16-3f363a17f259 payload: {"instance"=>"eb07cf1f-947b-4c66-68e7-ea97", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"Exited with status 1; cancelled; cancelled", "crash_count"=>4, "crash_timestamp"=>1501229342007707380, "version"=>"598f8269-c51d-4a10-9dd9-9e931c061890"} 2017-07-28T16:05:21.77+0800 [APP/PROC/WEB/0] ERR at java.lang.reflect.Method.invoke(Method.java:498) 2017-07-28T16:05:21.77+0800 [APP/PROC/WEB/0] ERR Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.rest.core.config.RepositoryRestConfiguration org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.config()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositories' defined in class org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.repository.support.Repositories org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.repositories()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityRepository': Cannot create inner bean '(inner bean)#e355e62' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#e355e62': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set 2017-07-28T16:05:21.77+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) 2017-07-28T16:05:21.78+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:990) 2017-07-28T16:05:21.78+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) 2017-07-28T16:05:21.78+0800 [APP/PROC/WEB/0] ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ... ...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/issues/1#issuecomment-318590801, or mute the thread https://github.com/notifications/unsubscribe-auth/ASo6Myr6fYDbi4qngQyrL0H6L8qjhlLZks5sSZiNgaJpZM4Ok1Mr .

-- 鞠国滨 Bin Ju +86 13662231177

roninby commented 7 years ago

The Java buildpack is v3.18:

Staging...
-----> Java Buildpack Version: v3.18 | https://github.com/cloudfoundry/java-buildpack.git#841ecb2

Is there any difference between PCF dev and OpenSource CloudFoundry? My app is running on a local OpenSource CF built on a vSphere cluster.

roninby commented 7 years ago

Got it. I just met the same problem as https://github.com/cloudfoundry/cf-mysql-release/issues/164.

pivotal-bin-ju commented 7 years ago

Hi,

I don't think we have any different between the CF and PCFDEV. But the buildpack itself might be developing with its own path. Go back to your env it might ship with a default "java_buildpack". The way you are doing is always to use the latest version of java buildpack.

Staging... -----> Java Buildpack Version: v3.18 | https://github.com/cloudfoundry/java-buildpack.git#841ecb2

Something I guess you're worth trying is: (relationship is "OR" NOT "AND") 1) use your local env's java-buildpack instead of the latest version. or 2) turn off auto configuration. Alter your manifest with: manifest.service:

1 ---

2 applications:

3 - name: instructor-cities-service

4 memory: 512M

5 instances: 1

6 path: build/libs/cities-service.jar

7 buildpack: java_buildpack NOTE: check it with cf buildpacks.

8 timeout: 180

9 services: [ mysql ]

10 env:

11 SPRING_PROFILES_ACTIVE: cloud

12 JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{enabled: false}'

On Fri, Jul 28, 2017 at 6:57 PM, roninby notifications@github.com wrote:

Got it. I just met the same problem as cloudfoundry/cf-mysql-release#164 https://github.com/cloudfoundry/cf-mysql-release/issues/164.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/issues/1#issuecomment-318623587, or mute the thread https://github.com/notifications/unsubscribe-auth/ASo6Mzh-yrpAHXwVnrJFYymElbf536POks5sSb6TgaJpZM4Ok1Mr .

-- 鞠国滨 Bin Ju +86 13662231177

roninby commented 7 years ago

@pivotal-bin-ju

The problem is fixed after creating an ASG for the Mysql service, just as mentioned in https://github.com/cloudfoundry/cf-mysql-release/issues/164

Thanks for your help.

pivotal-bin-ju commented 7 years ago

Glad to hear that. You are welcome!

On Mon, Jul 31, 2017 at 4:00 PM, roninby notifications@github.com wrote:

@pivotal-bin-ju https://github.com/pivotal-bin-ju

The problem is fixed after creating an ASG for the Mysql service, just as mentioned in cloudfoundry/cf-mysql-release#164 https://github.com/cloudfoundry/cf-mysql-release/issues/164

Thanks for your help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pivotal-Field-Engineering/pcf-workspace-devops/issues/1#issuecomment-318996610, or mute the thread https://github.com/notifications/unsubscribe-auth/ASo6M_hH4MMJqYjft1a_3EozCmNkkDDhks5sTYm7gaJpZM4Ok1Mr .

-- 鞠国滨 Bin Ju