@moriiSh (慎太郎 森井)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

herokuへデプロイは成功したがログでエラーが出ている

解決したいこと

heroku openでheroku logs --tailが出る

発生している問題・エラー

 Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-04-10T13:53:18.738341+00:00 app[web.1]: 13:53:18 [main] ERROR o.s.boot.SpringApplication - Application run failed
2022-04-10T13:53:18.738344+00:00 app[web.1]: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is java.lang.RuntimeException: Driver org.h2.Driver claims to not accept jdbcUrl, jdbc:postgresql://ec2-34-231-63-30.compute-1.amazonaws.com:5432/d6p418om2ifh2h?password=<masked>&sslmode=require&user=zzleziveznacrw
2022-04-10T13:53:18.738345+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
2022-04-10T13:53:18.738345+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
2022-04-10T13:53:18.738346+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
2022-04-10T13:53:18.738347+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
2022-04-10T13:53:18.738347+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
2022-04-10T13:53:18.738348+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
2022-04-10T13:53:18.738348+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
2022-04-10T13:53:18.738349+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2022-04-10T13:53:18.738349+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
2022-04-10T13:53:18.738349+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
2022-04-10T13:53:18.738350+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154)
2022-04-10T13:53:18.738350+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908)
2022-04-10T13:53:18.738350+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
2022-04-10T13:53:18.738351+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
2022-04-10T13:53:18.738351+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
2022-04-10T13:53:18.738352+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:414)
2022-04-10T13:53:18.738352+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
2022-04-10T13:53:18.738352+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
2022-04-10T13:53:18.738353+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
2022-04-10T13:53:18.738353+00:00 app[web.1]: at com.example.pictgram.PictgramApplication.main(PictgramApplication.java:10)
2022-04-10T13:53:18.738354+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-04-10T13:53:18.738354+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2022-04-10T13:53:18.738354+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-04-10T13:53:18.738355+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498)
2022-04-10T13:53:18.738355+00:00 app[web.1]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
2022-04-10T13:53:18.738355+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
2022-04-10T13:53:18.738356+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
2022-04-10T13:53:18.738356+00:00 app[web.1]: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
2022-04-10T13:53:18.738361+00:00 app[web.1]: Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is java.lang.RuntimeException: Driver org.h2.Driver claims to not accept jdbcUrl, jdbc:postgresql://ec2-34-231-63-30.compute-1.amazonaws.com:5432/d6p418om2ifh2h?password=<masked>&sslmode=require&user=zzleziveznacrw
2022-04-10T13:53:18.738365+00:00 app[web.1]: at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
2022-04-10T13:53:18.738366+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
2022-04-10T13:53:18.738366+00:00 app[web.1]: ... 27 common frames omitted
2022-04-10T13:53:18.738367+00:00 app[web.1]: Caused by: java.lang.RuntimeException: Driver org.h2.Driver claims to not accept jdbcUrl, jdbc:postgresql://ec2-34-231-63-30.compute-1.amazonaws.com:5432/d6p418om2ifh2h?password=<masked>&sslmode=require&user=zzleziveznacrw
2022-04-10T13:53:18.738368+00:00 app[web.1]: at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:110)
2022-04-10T13:53:18.738368+00:00 app[web.1]: at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:331)
2022-04-10T13:53:18.738368+00:00 app[web.1]: at com.zaxxer.hikari.pool.PoolBase.<init>(PoolBase.java:114)
2022-04-10T13:53:18.738368+00:00 app[web.1]: at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:108)
2022-04-10T13:53:18.738369+00:00 app[web.1]: at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
2022-04-10T13:53:18.738369+00:00 app[web.1]: at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:159)
2022-04-10T13:53:18.738369+00:00 app[web.1]: at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:117)
2022-04-10T13:53:18.738370+00:00 app[web.1]: at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
2022-04-10T13:53:18.738370+00:00 app[web.1]: at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:330)
2022-04-10T13:53:18.738370+00:00 app[web.1]: at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.isEmbedded(EmbeddedDatabaseConnection.java:162)
2022-04-10T13:53:18.738371+00:00 app[web.1]: at org.springframework.boot.autoconfigure.orm.jpa.HibernateDefaultDdlAutoProvider.getDefaultDdlAuto(HibernateDefaultDdlAutoProvider.java:42)
2022-04-10T13:53:18.738371+00:00 app[web.1]: at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.lambda$getVendorProperties$1(HibernateJpaConfiguration.java:130)
2022-04-10T13:53:18.738372+00:00 app[web.1]: at org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings.getDdlAuto(HibernateSettings.java:41)
2022-04-10T13:53:18.738372+00:00 app[web.1]: at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.determineDdlAuto(HibernateProperties.java:143)
2022-04-10T13:53:18.738373+00:00 app[web.1]: at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.getAdditionalProperties(HibernateProperties.java:103)
2022-04-10T13:53:18.738373+00:00 app[web.1]: at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.determineHibernateProperties(HibernateProperties.java:95)
2022-04-10T13:53:18.738373+00:00 app[web.1]: at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.getVendorProperties(HibernateJpaConfiguration.java:132)
2022-04-10T13:53:18.738374+00:00 app[web.1]: at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.entityManagerFactory(JpaBaseConfiguration.java:132)
2022-04-10T13:53:18.738374+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-04-10T13:53:18.738374+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2022-04-10T13:53:18.738374+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-04-10T13:53:18.738375+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498)
2022-04-10T13:53:18.738375+00:00 app[web.1]: at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
2022-04-10T13:53:18.738375+00:00 app[web.1]: ... 28 common frames omitted
2022-04-10T13:53:18.935121+00:00 heroku[web.1]: Process exited with status 1
2022-04-10T13:53:19.010625+00:00 heroku[web.1]: State changed from starting to crashed
2022-04-10T13:53:36.598739+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=techpictgram.herokuapp.com request_id=6c30628f-6462-4bfa-b732-a0ac56ad9ae1 fwd="218.220.13.180" dyno= connect= service= status=503 bytes= protocol=https
2022-04-10T13:53:36.847250+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=techpictgram.herokuapp.com request_id=5143e004-fe51-4f0f-8765-4affb708522e fwd="218.220.13.180" dyno= connect= service= status=503 bytes= protocol=https
2022-04-10T13:53:16.000000+00:00 app[api]: Build succeeded

0 likes

1Answer

Java に関する環境変数は定義されているのでしょうか?

(Java では無いのですが) 以前に同僚から、環境変数が有効になっていなくて動作しなかった、という話を聞いたことがあります.

0Like

Your answer might help someone💌