2016-11-27 90 views
0

無法在部署後運行應用程序。添加了clearDB插件並相應地修改了數據庫網址,用戶名和密碼。在部署heroku應用程序後創建jpa存儲庫時出錯

連接從SQL工作臺Heroku的cleardb和創建的表成功,但我仍然得到錯誤:

ion.java:263) ~[spring-data-rest-webmvc-2.5.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.448915+00:00 app[web.1]: at org.springframework.data.rest 
.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$b2c6e82b.C 
GLIB$config$0(<generated>) ~[spring-data-rest-webmvc-2.5.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.448915+00:00 app[web.1]: at org.springframework.data.rest 
.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$b2c6e82b$$ 
FastClassBySpringCGLIB$$78b891a4.invoke(<generated>) ~[spring-data-rest-webmvc-2 
.5.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.448948+00:00 app[web.1]: at org.springframework.cglib.pro 
xy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.4.RELEASE.jar 
!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448950+00:00 app[web.1]: at org.springframework.context.a 
nnotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(Configurati 
onClassEnhancer.java:356) ~[spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448950+00:00 app[web.1]: at org.springframework.data.rest 
.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$b2c6e82b.c 
onfig(<generated>) ~[spring-data-rest-webmvc-2.5.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.448951+00:00 app[web.1]: at sun.reflect.NativeMethodAcces 
sorImpl.invoke0(Native Method) ~[na:1.8.0_102-cedar14] 
2016-11-27T15:31:13.448952+00:00 app[web.1]: at sun.reflect.NativeMethodAcces 
sorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_102-cedar14] 
2016-11-27T15:31:13.448953+00:00 app[web.1]: at sun.reflect.DelegatingMethodA 
ccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_102-cedar14] 

2016-11-27T15:31:13.448953+00:00 app[web.1]: at java.lang.reflect.Method.invo 
ke(Method.java:498) ~[na:1.8.0_102-cedar14] 
2016-11-27T15:31:13.448954+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy 
.java:162) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448954+00:00 app[web.1]: ... 142 common frames omitted 
2016-11-27T15:31:13.448956+00:00 app[web.1]: Caused by: org.springframework.bean 
s.BeanInstantiationException: Failed to instantiate [org.springframework.data.re 
pository.support.Repositories]: Factory method 'repositories' threw exception; n 
ested exception is org.springframework.beans.factory.BeanCreationException: Erro 
r creating bean with name 'userRepository': Cannot create inner bean '(inner bea 
n)#17f1b4d4' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] wh 
ile setting bean property 'entityManager'; nested exception is org.springframewo 
rk.beans.factory.BeanCreationException: Error creating bean with name '(inner be 
an)#17f1b4d4': Cannot resolve reference to bean 'entityManagerFactory' while set 
ting constructor argument; nested exception is org.springframework.beans.factory 
.BeanCreationException: Error creating bean with name 'entityManagerFactory' def 
ined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/Hibe 
rnateJpaAutoConfiguration.class]: Invocation of init method failed; nested excep 
tion is org.hibernate.service.spi.ServiceException: Unable to create requested s 
ervice [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] 
2016-11-27T15:31:13.448957+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy 
.java:189) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448957+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolv 
er.java:588) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448958+00:00 app[web.1]: ... 163 common frames omitted 
2016-11-27T15:31:13.448959+00:00 app[web.1]: Caused by: org.springframework.bean 
s.factory.BeanCreationException: Error creating bean with name 'userRepository': 
Cannot create inner bean '(inner bean)#17f1b4d4' of type [org.springframework.o 
rm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; 
nested exception is org.springframework.beans.factory.BeanCreationException: Err 
or creating bean with name '(inner bean)#17f1b4d4': 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/springfram 
ework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocatio 
n of init method failed; nested exception is org.hibernate.service.spi.ServiceEx 
ception: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.J 
dbcEnvironment] 
2016-11-27T15:31:13.448960+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueRes 
olver.java:313) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448960+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionV 
alueResolver.java:129) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448984+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAuto 
wireCapableBeanFactory.java:1486) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEA 
SE] 
2016-11-27T15:31:13.448985+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCap 
ableBeanFactory.java:1231) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448986+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCap 
ableBeanFactory.java:551) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448986+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapab 
leBeanFactory.java:482) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448987+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spr 
ing-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448988+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegis 
try.java:230) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448989+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[sprin 
g-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448997+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring- 
beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448998+00:00 app[web.1]: at org.springframework.context.s 
upport.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1087) 
~[spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.448998+00:00 app[web.1]: at org.springframework.data.repo 
sitory.support.Repositories.cacheRepositoryFactory(Repositories.java:95) ~[sprin 
g-data-commons-1.12.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.448998+00:00 app[web.1]: at org.springframework.data.repo 
sitory.support.Repositories.populateRepositoryFactoryInformation(Repositories.ja 
va:88) ~[spring-data-commons-1.12.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.448999+00:00 app[web.1]: at org.springframework.data.repo 
sitory.support.Repositories.<init>(Repositories.java:81) ~[spring-data-commons-1 
.12.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.448999+00:00 app[web.1]: at org.springframework.data.rest 
.webmvc.config.RepositoryRestMvcConfiguration.repositories(RepositoryRestMvcConf 
iguration.java:194) ~[spring-data-rest-webmvc-2.5.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.449000+00:00 app[web.1]: at org.springframework.data.rest 
.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$b2c6e82b.C 
GLIB$repositories$13(<generated>) ~[spring-data-rest-webmvc-2.5.5.RELEASE.jar!/: 
na] 
2016-11-27T15:31:13.449000+00:00 app[web.1]: at org.springframework.data.rest 
.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$b2c6e82b$$ 
FastClassBySpringCGLIB$$78b891a4.invoke(<generated>) ~[spring-data-rest-webmvc-2 
.5.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.449001+00:00 app[web.1]: at org.springframework.cglib.pro 
xy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.4.RELEASE.jar 
!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449001+00:00 app[web.1]: at org.springframework.context.a 
nnotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(Configurati 
onClassEnhancer.java:356) ~[spring-context-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449001+00:00 app[web.1]: at org.springframework.data.rest 
.webmvc.config.RepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$b2c6e82b.r 
epositories(<generated>) ~[spring-data-rest-webmvc-2.5.5.RELEASE.jar!/:na] 
2016-11-27T15:31:13.449002+00:00 app[web.1]: at sun.reflect.NativeMethodAcces 
sorImpl.invoke0(Native Method) ~[na:1.8.0_102-cedar14] 
2016-11-27T15:31:13.449002+00:00 app[web.1]: at sun.reflect.NativeMethodAcces 
sorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_102-cedar14] 
2016-11-27T15:31:13.449003+00:00 app[web.1]: at sun.reflect.DelegatingMethodA 
ccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_102-cedar14] 

2016-11-27T15:31:13.449003+00:00 app[web.1]: at java.lang.reflect.Method.invo 
ke(Method.java:498) ~[na:1.8.0_102-cedar14] 
2016-11-27T15:31:13.449004+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy 
.java:162) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449004+00:00 app[web.1]: ... 164 common frames omitted 
2016-11-27T15:31:13.449037+00:00 app[web.1]: Caused by: org.springframework.bean 
s.factory.BeanCreationException: Error creating bean with name '(inner bean)#17f 
1b4d4': Cannot resolve reference to bean 'entityManagerFactory' while setting co 
nstructor argument; nested exception is org.springframework.beans.factory.BeanCr 
eationException: Error creating bean with name 'entityManagerFactory' defined in 
class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJp 
aAutoConfiguration.class]: Invocation of init method failed; nested exception is 
org.hibernate.service.spi.ServiceException: Unable to create requested service 
[org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] 
2016-11-27T15:31:13.449038+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueRes 
olver.java:359) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449039+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionV 
alueResolver.java:108) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449040+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver 
.java:634) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449040+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolv 
er.java:448) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449044+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(Ab 
stractAutowireCapableBeanFactory.java:1128) ~[spring-beans-4.3.4.RELEASE.jar!/:4 
.3.4.RELEASE] 
2016-11-27T15:31:13.449045+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutow 
ireCapableBeanFactory.java:1022) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEAS 
E] 
2016-11-27T15:31:13.449046+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCap 
ableBeanFactory.java:512) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449046+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapab 
leBeanFactory.java:482) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449046+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueRes 
olver.java:299) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449047+00:00 app[web.1]: ... 188 common frames omitted 
2016-11-27T15:31:13.449047+00:00 app[web.1]: Caused by: org.springframework.bean 
s.factory.BeanCreationException: Error creating bean with name 'entityManagerFac 
tory' defined in class path resource [org/springframework/boot/autoconfigure/orm 
/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nes 
ted exception is org.hibernate.service.spi.ServiceException: Unable to create re 
quested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] 
2016-11-27T15:31:13.449048+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireC 
apableBeanFactory.java:1583) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449048+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCap 
ableBeanFactory.java:553) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449048+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapab 
leBeanFactory.java:482) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449049+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spr 
ing-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449049+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegis 
try.java:230) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449049+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[sprin 
g-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449050+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring- 
beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449052+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueRes 
olver.java:351) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449052+00:00 app[web.1]: ... 196 common frames omitted 
2016-11-27T15:31:13.449053+00:00 app[web.1]: Caused by: org.hibernate.service.sp 
i.ServiceException: Unable to create requested service [org.hibernate.engine.jdb 
c.env.spi.JdbcEnvironment] 
2016-11-27T15:31:13.449053+00:00 app[web.1]: at org.hibernate.service.interna 
l.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:264 
) ~[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449054+00:00 app[web.1]: at org.hibernate.service.interna 
l.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java 
:228) ~[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449054+00:00 app[web.1]: at org.hibernate.service.interna 
l.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207) ~ 
[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449055+00:00 app[web.1]: at org.hibernate.service.interna 
l.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java 
:237) ~[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449054+00:00 app[web.1]: at org.hibernate.engine.jdbc.int 
ernal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51) ~[hibernate-core-5.0. 
11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449055+00:00 app[web.1]: at org.hibernate.service.interna 
l.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:207) ~ 
[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449055+00:00 app[web.1]: at org.hibernate.boot.registry.i 
nternal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl 
.java:94) ~[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449056+00:00 app[web.1]: at org.hibernate.boot.model.proc 
ess.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111) ~[hib 
ernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449057+00:00 app[web.1]: at org.springframework.orm.jpa.v 
endor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(
SpringHibernateJpaPersistenceProvider.java:60) ~[spring-orm-4.3.4.RELEASE.jar!/: 
4.3.4.RELEASE] 
2016-11-27T15:31:13.449058+00:00 app[web.1]: at org.springframework.orm.jpa.L 
ocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalCont 
ainerEntityManagerFactoryBean.java:353) ~[spring-orm-4.3.4.RELEASE.jar!/:4.3.4.R 
ELEASE] 
2016-11-27T15:31:13.449058+00:00 app[web.1]: at org.springframework.orm.jpa.A 
bstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityMa 
nagerFactoryBean.java:373) ~[spring-orm-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449057+00:00 app[web.1]: at org.hibernate.jpa.boot.intern 
al.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:87 
4) ~[hibernate-entitymanager-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449059+00:00 app[web.1]: at org.springframework.orm.jpa.A 
bstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryB 
ean.java:362) ~[spring-orm-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449056+00:00 app[web.1]: at org.hibernate.boot.model.proc 
ess.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352) ~[ 
hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449059+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowi 
reCapableBeanFactory.java:1642) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE 
] 
2016-11-27T15:31:13.449059+00:00 app[web.1]: at org.springframework.beans.fac 
tory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireC 
apableBeanFactory.java:1579) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE] 
2016-11-27T15:31:13.449056+00:00 app[web.1]: at org.hibernate.jpa.boot.intern 
al.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java 
:847) ~[hibernate-entitymanager-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449060+00:00 app[web.1]: ... 203 common frames omitted 
2016-11-27T15:31:13.449060+00:00 app[web.1]: Caused by: org.hibernate.HibernateE 
xception: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect 
' not set 
2016-11-27T15:31:13.449061+00:00 app[web.1]: at org.hibernate.engine.jdbc.dia 
lect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100) ~ 
[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449061+00:00 app[web.1]: at org.hibernate.engine.jdbc.dia 
lect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54) ~[hibe 
rnate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449061+00:00 app[web.1]: at org.hibernate.engine.jdbc.env 
.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java 
:137) ~[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449087+00:00 app[web.1]: at org.hibernate.engine.jdbc.env 
.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java 
:35) ~[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449088+00:00 app[web.1]: at org.hibernate.boot.registry.i 
nternal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl. 
java:88) ~[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449089+00:00 app[web.1]: at org.hibernate.service.interna 
l.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:254 
) ~[hibernate-core-5.0.11.Final.jar!/:5.0.11.Final] 
2016-11-27T15:31:13.449090+00:00 app[web.1]: ... 219 common frames omitted 
2016-11-27T15:31:13.449090+00:00 app[web.1]: 
2016-11-27T15:31:13.632183+00:00 heroku[web.1]: State changed from starting to c 
rashed 
2016-11-27T15:31:13.605808+00:00 heroku[web.1]: Process exited with status 1 
2016-11-27T15:34:03.069091+00:00 heroku[router]: at=error code=H10 desc="App cra 
shed" method=GET path="/" host=rootscopeit-in-spring.herokuapp.com request_id=77 
89d9e8-0b76-4e35-adc4-a98d61be5242 fwd="183.83.237.247" dyno= connect= service= 
status=503 bytes= 

數據庫的細節:

jdbc.driverClassName=com.mysql.jdbc.Driver 
jdbc.url=mysql://us-cdbr-iron-east-04.cleardb.net/heroku_505130b7010a272?reconnect=true 
jdbc.username=b35ede5944880e 
jdbc.password=password here 
#spring.jpa.hibernate.ddl-auto=update 
server.port=8084 

應用程序配置類:

@Configuration 
@ComponentScan 
@EnableTransactionManagement 
@PropertySource(value = {"classpath:application.properties"}) 
public class AppConfig { 

    @Autowired 
    private Environment env; 

    @Value("${init-db:false}") 
    private String initDatabase; 

    public static PropertySourcesPlaceholderConfigurer placeHolderConfigurer() { 
     return new PropertySourcesPlaceholderConfigurer(); 
    } 

    @Bean 
    public JdbcTemplate jdbcTemplate(DataSource dataSource) { 
     return new JdbcTemplate(dataSource); 
    } 

    @Bean 
    public PlatformTransactionManager transactionManager(DataSource dataSource) { 
     return new DataSourceTransactionManager(dataSource); 
    } 

    @Bean 
    @Primary 
    public DataSource dataSource() { 
     BasicDataSource dataSource = new BasicDataSource(); 
     dataSource.setDriverClassName(env.getProperty("jdbc.driverClassName")); 
     dataSource.setUrl(env.getProperty("jdbc.url")); 
     dataSource.setUsername(env.getProperty("jdbc.username")); 
     dataSource.setPassword(env.getProperty("jdbc.password")); 
     return new org.apache.tomcat.jdbc.pool.DataSource(); 
    } 

    @Bean 
    public DataSourceInitializer dataSourceInitializer(DataSource dataSource) { 
     DataSourceInitializer dataSourceInitializer = new DataSourceInitializer(); 
     dataSourceInitializer.setDataSource(dataSource); 
     ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator(); 
     databasePopulator.addScript(new ClassPathResource("data.sql")); 
     dataSourceInitializer.setDatabasePopulator(databasePopulator); 
     dataSourceInitializer.setEnabled(Boolean.parseBoolean(initDatabase)); 
     return dataSourceInitializer; 
    } 
} 

我在heroku中使用spring 1.4.3版本。我不確定這是Heroku支持的正確版本。可能是什麼問題?

回答

1

首先,立即重置您的數據庫憑據(因爲您已經在互聯網上公開發布了它們)。你必須參考ClearDB documentation的說明。

然後use the JDBC_DATABASE_URL而不是硬編碼您的連接參數。你可以把這個在你的代碼:

dataSource.setUrl(System.getenv("JDBC_DATABASE_URL"); 

如果這仍然給你的問題,嘗試JawsDB add-on代替(它似乎有少的問題)。

+0

我沒有提及有問題的密碼 – Satyadev

+0

問題是您的JDBC URL不是JDBC URL。它應該從'jdbc:mysql://'開始,但是你只需要'mysql://' – codefinger

+0

我會用你剛纔提到的jdbc-url來嘗試。我已經試過jdbc: – Satyadev

相關問題