Deploying a Spring boot app to Heroku - java

I've been recently trying to deploy an app to Heroku, but it has been proven to be a nightmare to do so. I've got a little web app that works just fine when run locally on my computer, but when run on Heroku, it complaints about a number of errors and I dont have an idea why. I've spent good 10 hours trying to figure out whats going on, but I'm no wiser :/
This is the error I'm getting on Heroku:
2015-07-31T12:27:23.402408+00:00 app[web.1]: 2015-07-31 12:27:23.388 INFO 5 --- [ main] net.wazim.chestnut.ChestnutRunner : Starting ChestnutRunner on 535432cb-b4ba-4353-b753-c90ba501b299 with PID 5 (/app/target/chestnut-jar-with-dependencies.jar started by u55201 in /ap
)
2015-07-31T12:27:23.541824+00:00 app[web.1]: 2015-07-31 12:27:23.541 INFO 5 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#6e6c3152: startup date [Fri Jul 31 12:27:23 UTC
015]; root of context hierarchy
2015-07-31T12:27:24.289699+00:00 app[web.1]: 2015-07-31 12:27:24.289 ERROR 5 --- [ main] o.s.boot.SpringApplication : Application startup failed
2015-07-31T12:27:24.289702+00:00 app[web.1]:
2015-07-31T12:27:24.289704+00:00 app[web.1]: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServl
tContainerFactory bean.
2015-07-31T12:27:24.289705+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
2015-07-31T12:27:24.289707+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
2015-07-31T12:27:24.289708+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
2015-07-31T12:27:24.289711+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
2015-07-31T12:27:24.289714+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
2015-07-31T12:27:24.289713+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
2015-07-31T12:27:24.289710+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
2015-07-31T12:27:24.289719+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:183)
2015-07-31T12:27:24.289716+00:00 app[web.1]: at net.wazim.chestnut.ChestnutRunner.main(ChestnutRunner.java:20)
2015-07-31T12:27:24.289723+00:00 app[web.1]: ... 7 common frames omitted
2015-07-31T12:27:24.289718+00:00 app[web.1]: Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
2015-07-31T12:27:24.289720+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:156)
2015-07-31T12:27:24.289725+00:00 app[web.1]:
2015-07-31T12:27:24.289722+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
2015-07-31T12:27:24.292299+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
2015-07-31T12:27:24.291255+00:00 app[web.1]: Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext d
e to missing EmbeddedServletContainerFactory bean.
2015-07-31T12:27:24.293484+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
2015-07-31T12:27:24.292817+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
2015-07-31T12:27:24.293709+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
2015-07-31T12:27:24.293881+00:00 app[web.1]: at net.wazim.chestnut.ChestnutRunner.main(ChestnutRunner.java:20)
2015-07-31T12:27:24.295144+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:156)
2015-07-31T12:27:24.294360+00:00 app[web.1]: Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
2015-07-31T12:27:24.287624+00:00 app[web.1]: 2015-07-31 12:27:24.286 WARN 5 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt
2015-07-31T12:27:24.287629+00:00 app[web.1]:
2015-07-31T12:27:24.287632+00:00 app[web.1]: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServl
tContainerFactory bean.
2015-07-31T12:27:24.287635+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
2015-07-31T12:27:24.287634+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
2015-07-31T12:27:24.287637+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
2015-07-31T12:27:24.287638+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
2015-07-31T12:27:24.287640+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
2015-07-31T12:27:24.287642+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
2015-07-31T12:27:24.287643+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
2015-07-31T12:27:24.287644+00:00 app[web.1]: at net.wazim.chestnut.ChestnutRunner.main(ChestnutRunner.java:20)
2015-07-31T12:27:24.287646+00:00 app[web.1]: Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
2015-07-31T12:27:24.287653+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:183)
2015-07-31T12:27:24.287655+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:156)
2015-07-31T12:27:24.287656+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
2015-07-31T12:27:24.287658+00:00 app[web.1]: ... 7 common frames omitted
2015-07-31T12:27:24.287659+00:00 app[web.1]:
2015-07-31T12:27:24.292573+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
2015-07-31T12:27:24.288925+00:00 app[web.1]: 2015-07-31 12:27:24.288 INFO 5 --- [ main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/app/target/chestnut-jar-with-dependencies.jar]
2015-07-31T12:27:24.293047+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
2015-07-31T12:27:24.291522+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
2015-07-31T12:27:24.294699+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:183)
2015-07-31T12:27:24.295403+00:00 app[web.1]: at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
2015-07-31T12:27:24.295483+00:00 app[web.1]: ... 7 more
2015-07-31T12:27:25.312750+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-31T12:27:25.296215+00:00 heroku[web.1]: Process exited with status 1
2015-07-31T12:27:30.103618+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=agile-dusk-9746.herokuapp.com request_id=cce27fd9-9bbc-4a9e-9611-b38535dc9ade fwd="82.3.147.97" dyno= connect= service= status=503 bytes=

Try java $JAVA_OPTS -Dserver.port=$PORT -jar ... into Procfile

Related

Running Spring app built with gradle and flyway on Heroku

I have a problem deploying my Spring boot application with gradle on heroku. The project works with flyway on migrations and postgres as database, I'm trying to do the deploy, but heroku is complaining and giving the following log:
2022-01-11T16:08:15.174724+00:00 app[web.1]: 2022-01-11 16:08:15.174 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:15.310829+00:00 app[web.1]: 2022-01-11 16:08:15.310 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:15.458987+00:00 app[web.1]: 2022-01-11 16:08:15.458 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:15.557556+00:00 app[web.1]: 2022-01-11 16:08:15.557 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:15.660010+00:00 app[web.1]: 2022-01-11 16:08:15.659 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:15.758015+00:00 app[web.1]: 2022-01-11 16:08:15.757 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:15.926062+00:00 app[web.1]: 2022-01-11 16:08:15.925 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:15.950385+00:00 app[web.1]: 2022-01-11 16:08:15.950 INFO 4 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" to version "018 - criarArquivos"
2022-01-11T16:08:16.100506+00:00 app[web.1]: 2022-01-11 16:08:16.100 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:16.143832+00:00 app[web.1]: 2022-01-11 16:08:16.143 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:16.162863+00:00 app[web.1]: 2022-01-11 16:08:16.162 INFO 4 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" to version "019 - criarArquivosProposta"
2022-01-11T16:08:16.294016+00:00 app[web.1]: 2022-01-11 16:08:16.293 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:16.336561+00:00 app[web.1]: 2022-01-11 16:08:16.336 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:16.362030+00:00 app[web.1]: 2022-01-11 16:08:16.361 INFO 4 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" to version "020 - criarArquivosEdital"
2022-01-11T16:08:16.469778+00:00 app[web.1]: 2022-01-11 16:08:16.469 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:16.531438+00:00 app[web.1]: 2022-01-11 16:08:16.531 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:16.551781+00:00 app[web.1]: 2022-01-11 16:08:16.551 INFO 4 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema "public" to version "021 - criarArquivosUsuario"
2022-01-11T16:08:16.646818+00:00 app[web.1]: 2022-01-11 16:08:16.646 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:16.717529+00:00 app[web.1]: 2022-01-11 16:08:16.717 INFO 4 --- [ main] o.f.c.i.s.DefaultSqlScriptExecutor : 0 rows affected
2022-01-11T16:08:16.737369+00:00 app[web.1]: 2022-01-11 16:08:16.737 INFO 4 --- [ main] o.f.core.internal.command.DbMigrate : Successfully applied 21 migrations to schema "public", now at version v021 (execution time 00:11.952s)
2022-01-11T16:08:16.974590+00:00 app[web.1]: 2022-01-11 16:08:16.974 INFO 4 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-01-11T16:08:17.048129+00:00 app[web.1]: 2022-01-11 16:08:17.047 INFO 4 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.32.Final
2022-01-11T16:08:17.275410+00:00 app[web.1]: 2022-01-11 16:08:17.275 INFO 4 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-01-11T16:08:17.435786+00:00 app[web.1]: 2022-01-11 16:08:17.435 INFO 4 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
2022-01-11T16:08:20.352207+00:00 app[web.1]: 2022-01-11 16:08:20.351 INFO 4 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-01-11T16:08:20.365827+00:00 app[web.1]: 2022-01-11 16:08:20.365 INFO 4 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-01-11T16:08:20.556259+00:00 app[web.1]: 2022-01-11 16:08:20.556 WARN 4 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2022-01-11T16:08:24.205506+00:00 app[web.1]: 2022-01-11 16:08:24.205 WARN 4 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'arquivosController': Unsatisfied dependency expressed through field 'arquivosPropostasService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arquivosPropostasService': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'arquivos.propostas' in value "${arquivos.propostas}"
2022-01-11T16:08:24.220521+00:00 app[web.1]: 2022-01-11 16:08:24.220 INFO 4 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2022-01-11T16:08:24.222658+00:00 app[web.1]: 2022-01-11 16:08:24.222 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2022-01-11T16:08:24.255639+00:00 app[web.1]: 2022-01-11 16:08:24.255 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2022-01-11T16:08:24.258455+00:00 app[web.1]: 2022-01-11 16:08:24.258 INFO 4 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-01-11T16:08:24.285249+00:00 app[web.1]: 2022-01-11 16:08:24.285 INFO 4 --- [ main] ConditionEvaluationReportLoggingListener :
2022-01-11T16:08:24.285251+00:00 app[web.1]:
2022-01-11T16:08:24.285253+00:00 app[web.1]: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-01-11T16:08:24.319226+00:00 app[web.1]: 2022-01-11 16:08:24.318 ERROR 4 --- [ main] o.s.boot.SpringApplication : Application run failed
2022-01-11T16:08:24.319228+00:00 app[web.1]:
2022-01-11T16:08:24.319231+00:00 app[web.1]: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'arquivosController': Unsatisfied dependency expressed through field 'arquivosPropostasService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arquivosPropostasService': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'arquivos.propostas' in value "${arquivos.propostas}"
2022-01-11T16:08:24.319239+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319239+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319240+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319241+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319242+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319242+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319243+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319246+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319246+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319246+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319247+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319247+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319247+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319248+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319248+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.2.jar!/:2.5.2]
2022-01-11T16:08:24.319248+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) [spring-boot-2.5.2.jar!/:2.5.2]
2022-01-11T16:08:24.319249+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) [spring-boot-2.5.2.jar!/:2.5.2]
2022-01-11T16:08:24.319249+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) [spring-boot-2.5.2.jar!/:2.5.2]
2022-01-11T16:08:24.319250+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) [spring-boot-2.5.2.jar!/:2.5.2]
2022-01-11T16:08:24.319250+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) [spring-boot-2.5.2.jar!/:2.5.2]
2022-01-11T16:08:24.319250+00:00 app[web.1]: at com.sti.sigproj.SigprojApplication.main(SigprojApplication.java:10) [classes!/:0.0.1-SNAPSHOT]
2022-01-11T16:08:24.319253+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_312-heroku]
2022-01-11T16:08:24.319253+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_312-heroku]
2022-01-11T16:08:24.319258+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_312-heroku]
2022-01-11T16:08:24.319259+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_312-heroku]
2022-01-11T16:08:24.319259+00:00 app[web.1]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [sigproj-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2022-01-11T16:08:24.319259+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) [sigproj-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2022-01-11T16:08:24.319259+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [sigproj-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2022-01-11T16:08:24.319259+00:00 app[web.1]: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) [sigproj-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2022-01-11T16:08:24.319261+00:00 app[web.1]: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arquivosPropostasService': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'arquivos.propostas' in value "${arquivos.propostas}"
2022-01-11T16:08:24.319261+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:405) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319261+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319262+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319262+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319262+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319263+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319263+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319263+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319264+00:00 app[web.1]: at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319264+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319264+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319265+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319266+00:00 app[web.1]: ... 28 common frames omitted
2022-01-11T16:08:24.319266+00:00 app[web.1]: Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'arquivos.propostas' in value "${arquivos.propostas}"
2022-01-11T16:08:24.319266+00:00 app[web.1]: at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180) ~[spring-core-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319267+00:00 app[web.1]: at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) ~[spring-core-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319267+00:00 app[web.1]: at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239) ~[spring-core-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319267+00:00 app[web.1]: at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) ~[spring-core-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319267+00:00 app[web.1]: at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:175) ~[spring-context-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319268+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:936) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319270+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1321) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319271+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319271+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319271+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319271+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319272+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.8.jar!/:5.3.8]
2022-01-11T16:08:24.319272+00:00 app[web.1]: ... 39 common frames omitted
2022-01-11T16:08:24.319272+00:00 app[web.1]:
2022-01-11T16:08:24.514445+00:00 heroku[web.1]: Process exited with status 1
2022-01-11T16:08:24.655431+00:00 heroku[web.1]: State changed from starting to crashed
2022-01-11T16:08:25.702604+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=api-sistemaderegistroatual.herokuapp.com request_id=7d4601b8-32fa-4a8a-b375-c03c3d194bf6 fwd="179.124.141.140" dyno= connect= service= status=503 bytes= protocol=https
2022-01-11T16:08:26.525942+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=api-sistemaderegistroatual.herokuapp.com request_id=95fbafa2-4c6a-40c5-b6cb-4d0a1217eb39 fwd="179.124.141.140" dyno= connect= service= status=503 bytes= protocol=https
This is my current build.gradle:
plugins {
id 'java'
id 'maven-publish'
id "org.springframework.boot" version "2.5.2"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
}
jar {
manifest {
attributes(
'Main-Class': 'com.sti.sigproj.SigprojApplication'
)
}
}
repositories {
mavenLocal()
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:2.5.2'
implementation 'org.springframework.boot:spring-boot-starter-validation:2.5.2'
implementation 'org.springframework.boot:spring-boot-starter-web:2.5.2'
implementation 'org.flywaydb:flyway-core:7.7.3'
implementation 'org.springframework.boot:spring-boot-starter-security:2.5.2'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client:2.5.2'
implementation 'org.modelmapper.extensions:modelmapper-spring:2.3.0'
implementation 'commons-codec:commons-codec:1.15'
implementation 'io.jsonwebtoken:jjwt:0.7.0'
implementation 'org.springframework.boot:spring-boot-starter-mail:2.5.2'
implementation 'io.springfox:springfox-swagger2:2.9.2'
implementation 'io.springfox:springfox-swagger-ui:2.9.2'
implementation('com.github.javafaker:javafaker:1.0.2') { exclude module: 'snakeyaml' }
runtimeOnly 'com.h2database:h2:1.4.200'
runtimeOnly 'org.springframework.boot:spring-boot-devtools:2.5.2'
runtimeOnly 'org.postgresql:postgresql:42.2.22'
testImplementation 'org.flywaydb.flyway-test-extensions:flyway-spring-test:5.0.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.5.2'
testImplementation 'org.springframework.security:spring-security-test:5.5.1'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.7.2'
}
group = 'com.sti.sigproj'
version = '0.0.1-SNAPSHOT'
description = 'sigproj'
java.sourceCompatibility = JavaVersion.VERSION_1_8
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
test {
useJUnitPlatform()
}
And here is the procfile:
web: java -Dserver.port=$PORT $JAVA_OPTS -jar target/sigproj-0.0.1-SNAPSHOT.jar
flyway:migrate
Here is the part heroku is complaining in the arquivosPropostaService.java:
#Value("${arquivos.propostas.doc-chefia-imediata}")
private String diretorioDocsChefiaImediata;
That leads to application.properties:
arquivos.propostas=/arquivos/propostas
arquivos.propostas.doc-chefia-imediata=/docs-chefia-imediata
The project contains maven and recently was changed to gradle. I think the problem is in the procfile and in build.gradle or maybe some lack in config vars, an old version of the project worked on maven, but the current version needs gradle.

Problem with date loading in Spring App deployed to Heroku

I have a simple spring boot application using postgres as a database. When I run the application locally everything is fine, but when I deploy it to heroku I get a NullPointerException when accessing the date property of the User object. When the bean is initialized, a User is created, the payment field initiated with new date, then the user is saved to the database, if after that the user is retrieved from the database, the date is null. When I run the application on local postgres everything is fine, the date is saved and after reloading the user it is present. What might be causing this error?
Here's User class
#Entity
#Table(name = "users")
public class User {
#Id
#GeneratedValue(strategy = GenerationType.AUTO)
#Column(name = "id")
private int id;
#Column(name = "name")
private String name;
#Column(name = "login")
private String login;
#Column(name = "password")
private String password;
#Column(name = "current_fund")
private int currentFund;
#Column(name = "payment")
private Date payment;
And here's how User is created in userService:
#Service
public class UserService {
#Autowired
private UserRepo userRepo;
public UserService() {
}
public void save(User user) {
userRepo.save(user);
}
public User getUser() {
System.err.println("===============================");
System.err.println("=IN USER SERVICE NOW=");
System.err.println("===============================");
User user = new User();
user.setCurrentFund(0);
user.setLogin("1");
user.setPassword("2");
user.setName("45");
user.setPayment(new Date());
System.err.println("===============================");
System.err.println("=USER CREATED=" + user.toString());
System.err.println("===============================");
userRepo.save(user);
System.err.println("===============================");
System.err.println("=USER SAVED=");
System.err.println("===============================");
User us = userRepo.findAll().iterator().next();
System.err.println("===============================");
System.err.println("=USER LOADED=" + us);
System.err.println("===============================");
return us;
}
}
Here's Heroku logs tail:
2021-10-15T09:26:51.323443+00:00 app[web.1]: 2021-10-15 09:26:51.323 INFO 4 --- [ task-1] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-10-15T09:26:51.326054+00:00 app[web.1]: ===============================
2021-10-15T09:26:51.326080+00:00 app[web.1]: =IN EVENT SERVICE INIT=
2021-10-15T09:26:51.326107+00:00 app[web.1]: ===============================
2021-10-15T09:26:51.326144+00:00 app[web.1]: ===============================
2021-10-15T09:26:51.326170+00:00 app[web.1]: =IN USER SERVICE NOW=
2021-10-15T09:26:51.326195+00:00 app[web.1]: ===============================
2021-10-15T09:26:51.326426+00:00 app[web.1]: ===============================
2021-10-15T09:26:51.326701+00:00 app[web.1]: =USER CREATED=User{id=0, name='45', login='1', password='2', currentFund=0, lastPaymentDate=Wed Sep 15 09:26:51 UTC 2021}
2021-10-15T09:26:51.326730+00:00 app[web.1]: ===============================
2021-10-15T09:26:52.018035+00:00 app[web.1]: 2021-10-15 09:26:52.017 INFO 4 --- [ task-1] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.21.Final
2021-10-15T09:26:52.170196+00:00 app[web.1]: 2021-10-15 09:26:52.170 INFO 4 --- [ task-1] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2021-10-15T09:26:52.994040+00:00 app[web.1]: 2021-10-15 09:26:52.993 INFO 4 --- [ task-1] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10Dialect
2021-10-15T09:26:54.444953+00:00 app[web.1]: 2021-10-15 09:26:54.444 INFO 4 --- [ task-1] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-10-15T09:26:54.455185+00:00 app[web.1]: 2021-10-15 09:26:54.454 INFO 4 --- [ task-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-10-15T09:26:55.163731+00:00 app[web.1]: ===============================
2021-10-15T09:26:55.163755+00:00 app[web.1]: =USER SAVED=
2021-10-15T09:26:55.163777+00:00 app[web.1]: ===============================
2021-10-15T09:26:55.355926+00:00 app[web.1]: ===============================
2021-10-15T09:26:55.355965+00:00 app[web.1]: =USER LOADED=User{id=1, name='45', login='1', password='2', currentFund=0, lastPaymentDate=null}
2021-10-15T09:26:55.355999+00:00 app[web.1]: ===============================
2021-10-15T09:26:55.356028+00:00 app[web.1]: ===============================
2021-10-15T09:26:55.356079+00:00 app[web.1]: =USER=User{id=1, name='45', login='1', password='2', currentFund=0, lastPaymentDate=null}
2021-10-15T09:26:55.356107+00:00 app[web.1]: ===============================
2021-10-15T09:26:55.402277+00:00 app[web.1]: start events update
2021-10-15T09:26:55.408357+00:00 app[web.1]: 2021-10-15 09:26:55.408 WARN 4 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'purchaseController': Unsatisfied dependency expressed through field 'eventsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventsService': Invocation of init method failed; nested exception is java.lang.NullPointerException
2021-10-15T09:26:55.408900+00:00 app[web.1]: 2021-10-15 09:26:55.408 INFO 4 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-10-15T09:26:55.410937+00:00 app[web.1]: 2021-10-15 09:26:55.410 INFO 4 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-10-15T09:26:55.411578+00:00 app[web.1]: 2021-10-15 09:26:55.411 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-10-15T09:26:55.967177+00:00 app[web.1]: 2021-10-15 09:26:55.966 INFO 4 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2021-10-15T09:26:55.969102+00:00 app[web.1]: 2021-10-15 09:26:55.968 INFO 4 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-10-15T09:26:55.978337+00:00 app[web.1]: 2021-10-15 09:26:55.978 INFO 4 --- [ main] ConditionEvaluationReportLoggingListener :
2021-10-15T09:26:55.978338+00:00 app[web.1]:
2021-10-15T09:26:55.978339+00:00 app[web.1]: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-10-15T09:26:55.982750+00:00 app[web.1]: 2021-10-15 09:26:55.982 ERROR 4 --- [ main] o.s.boot.SpringApplication : Application run failed
2021-10-15T09:26:55.982754+00:00 app[web.1]:
2021-10-15T09:26:55.982761+00:00 app[web.1]: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'purchaseController': Unsatisfied dependency expressed through field 'eventsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventsService': Invocation of init method failed; nested exception is java.lang.NullPointerException
2021-10-15T09:26:55.982762+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982762+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982764+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982765+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982765+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982765+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982766+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982766+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982767+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982767+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982767+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982768+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982768+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982768+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.4.RELEASE.jar!/:2.3.4.RELEASE]
2021-10-15T09:26:55.982769+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.4.RELEASE.jar!/:2.3.4.RELEASE]
2021-10-15T09:26:55.982769+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.4.RELEASE.jar!/:2.3.4.RELEASE]
2021-10-15T09:26:55.982770+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.4.RELEASE.jar!/:2.3.4.RELEASE]
2021-10-15T09:26:55.982770+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.4.RELEASE.jar!/:2.3.4.RELEASE]
2021-10-15T09:26:55.982770+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.4.RELEASE.jar!/:2.3.4.RELEASE]
2021-10-15T09:26:55.982771+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.4.RELEASE.jar!/:2.3.4.RELEASE]
2021-10-15T09:26:55.982771+00:00 app[web.1]: at main.Main.main(Main.java:9) [classes!/:1.0-SNAPSHOT]
2021-10-15T09:26:55.982772+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_302-heroku]
2021-10-15T09:26:55.982772+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_302-heroku]
2021-10-15T09:26:55.982776+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_302-heroku]
2021-10-15T09:26:55.982777+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_302-heroku]
2021-10-15T09:26:55.982777+00:00 app[web.1]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [purchase-planner-web2-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
2021-10-15T09:26:55.982777+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:107) [purchase-planner-web2-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
2021-10-15T09:26:55.982778+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [purchase-planner-web2-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
2021-10-15T09:26:55.982778+00:00 app[web.1]: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) [purchase-planner-web2-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
2021-10-15T09:26:55.982779+00:00 app[web.1]: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventsService': Invocation of init method failed; nested exception is java.lang.NullPointerException
2021-10-15T09:26:55.982779+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982779+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:415) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982780+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982780+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982780+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982781+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982781+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982781+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982781+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982782+00:00 app[web.1]: at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982782+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982782+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982783+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982783+00:00 app[web.1]: ... 28 common frames omitted
2021-10-15T09:26:55.982784+00:00 app[web.1]: Caused by: java.lang.NullPointerException: null
2021-10-15T09:26:55.982784+00:00 app[web.1]: at java.util.Calendar.setTime(Calendar.java:1770) ~[na:1.8.0_302-heroku]
2021-10-15T09:26:55.982785+00:00 app[web.1]: at main.handlers.EventsService.getDate0AM(EventsService.java:246) ~[classes!/:1.0-SNAPSHOT]
2021-10-15T09:26:55.982785+00:00 app[web.1]: at main.handlers.EventsService.fillWithEmptyPayments(EventsService.java:72) ~[classes!/:1.0-SNAPSHOT]
2021-10-15T09:26:55.982785+00:00 app[web.1]: at main.handlers.EventsService.updateEvents(EventsService.java:49) ~[classes!/:1.0-SNAPSHOT]
2021-10-15T09:26:55.982786+00:00 app[web.1]: at main.handlers.EventsService.init(EventsService.java:42) ~[classes!/:1.0-SNAPSHOT]
2021-10-15T09:26:55.982786+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_302-heroku]
2021-10-15T09:26:55.982787+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_302-heroku]
2021-10-15T09:26:55.982789+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_302-heroku]
2021-10-15T09:26:55.982790+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_302-heroku]
2021-10-15T09:26:55.982791+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982791+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982791+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
2021-10-15T09:26:55.982792+00:00 app[web.1]: ... 40 common frames omitted
2021-10-15T09:26:55.982792+00:00 app[web.1]:
2021-10-15T09:26:56.147680+00:00 heroku[web.1]: Process exited with status 1
When comment out all references to "payment" field, app starts just fine.
Also, there are other objects in my app, using Date as one of their fields, and these objects are loaded properly

SpringBoot + RabbitMQ throwing error : java.net.ConnectException: Connection refused

I have hosted a multimodule project on heroku and receiving the following error when trying to run my Spring Boot Application.
2018-06-13T05:34:47.611296+00:00 app[web.1]: 2018-06-13 05:34:47.611 INFO 4 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'rabbitConnectionFactory' has been autodetected for JMX exposure
2018-06-13T05:34:47.617422+00:00 app[web.1]: 2018-06-13 05:34:47.617 INFO 4 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'rabbitConnectionFactory': registering with JMX server as MBean [org.springframework.amqp.rabbit.connection:name=rabbitConnectionFactory,type=CachingConnectionFactory]
2018-06-13T05:34:47.646470+00:00 app[web.1]: 2018-06-13 05:34:47.646 INFO 4 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647
2018-06-13T05:34:47.660578+00:00 app[web.1]: 2018-06-13 05:34:47.660 INFO 4 --- [ container-1] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
2018-06-13T05:34:47.680639+00:00 app[web.1]: 2018-06-13 05:34:47.679 ERROR 4 --- [ container-1] o.s.a.r.l.SimpleMessageListenerContainer : Failed to check/redeclare auto-delete queue(s).
2018-06-13T05:34:47.680646+00:00 app[web.1]:
2018-06-13T05:34:47.680648+00:00 app[web.1]: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused (Connection refused)
2018-06-13T05:34:47.680650+00:00 app[web.1]: at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:34:47.680651+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:476) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:34:47.680656+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:614) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:34:47.680658+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:240) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:34:47.680659+00:00 app[web.1]: at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1797) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
The issue I see is, it is trying to connect some localhost whereas I have my addon CloudAMQP
Little Lemur added in heroku and I have added these to my both Application.yml file:
spring:
profiles: heroku
mvc:
async:
request-timeout: 3600000
rabbitmq:
addresses: amqp://****:*****#puma.rmq.cloudamqp.com/uyjgxslh
host: puma.rmq.cloudamqp.com
port: 1883
username: ****:****
password: *****
In my webModule I have this code:
#SpringBootApplication
public class SpringBootHerokuExampleApplication {
public final static String PDF_MERGE_QUEUE= "pdf-merge-queue";
#Bean
Queue queue(){
return new Queue(PDF_MERGE_QUEUE, false);
}
#Bean
TopicExchange exchange(){
return new TopicExchange("pdf-nerge-exchange");
}
#Bean
Binding binding(Queue queue, TopicExchange topicExchange){
return BindingBuilder.bind(queue).to(topicExchange).with(PDF_MERGE_QUEUE);
}
#Bean
SimpleMessageListenerContainer container(ConnectionFactory connectionFactory,
MessageListenerAdapter listenerAdapter){
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory);
container.setQueueNames(PDF_MERGE_QUEUE);
container.setMessageListener(listenerAdapter);
return container;
}
#Bean
MessageListenerAdapter listenerAdapter(RabbitMQListener rabbitMQListener){
return new MessageListenerAdapter(rabbitMQListener, "receiveMessage");
}
public static void main(String[] args) {
SpringApplication.run(SpringBootHerokuExampleApplication.class, args);
}
}
and in my worker module main method:
public class SpringBootHerokuExampleApplication {
public final static String PDF_MERGE_QUEUE= "pdf-merge-queue";
public static void main(String[] args) {
SpringApplication.run(SpringBootHerokuExampleApplication.class, args);
}
}
Please find below some more stack trace from Heroku logs :
handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-06-13T05:54:13.871350+00:00 app[worker.1]: 2018-06-13 05:54:13.870 INFO 4 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2018-06-13T05:54:13.897860+00:00 app[worker.1]: 2018-06-13 05:54:13.897 INFO 4 --- [ main] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped "{[/actuator/health],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.String>)
2018-06-13T05:54:13.899632+00:00 app[worker.1]: 2018-06-13 05:54:13.899 INFO 4 --- [ main] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped "{[/actuator/info],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.String>)
2018-06-13T05:54:13.901591+00:00 app[worker.1]: 2018-06-13 05:54:13.901 INFO 4 --- [ main] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped "{[/actuator],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto protected java.util.Map<java.lang.String, java.util.Map<java.lang.String, org.springframework.boot.actuate.endpoint.web.Link>> org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping.links(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-06-13T05:54:14.128560+00:00 app[worker.1]: 2018-06-13 05:54:14.128 INFO 4 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-06-13T05:54:14.145677+00:00 app[worker.1]: 2018-06-13 05:54:14.145 INFO 4 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'rabbitConnectionFactory' has been autodetected for JMX exposure
2018-06-13T05:54:14.154055+00:00 app[worker.1]: 2018-06-13 05:54:14.153 INFO 4 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located managed bean 'rabbitConnectionFactory': registering with JMX server as MBean [org.springframework.amqp.rabbit.connection:name=rabbitConnectionFactory,type=CachingConnectionFactory]
2018-06-13T05:54:14.199050+00:00 app[worker.1]: 2018-06-13 05:54:14.197 INFO 4 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647
2018-06-13T05:54:14.230846+00:00 app[worker.1]: 2018-06-13 05:54:14.230 INFO 4 --- [cTaskExecutor-1] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
2018-06-13T05:54:14.425996+00:00 app[worker.1]: 2018-06-13 05:54:14.425 INFO 4 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-06-13T05:54:14.437981+00:00 app[worker.1]: 2018-06-13 05:54:14.435 INFO 4 --- [ main] o.e.SpringBootHerokuExampleApplication : Started SpringBootHerokuExampleApplication in 13.198 seconds (JVM running for 14.523)
2018-06-13T05:54:14.969935+00:00 app[web.1]: 2018-06-13 05:54:14.969 WARN 4 --- [ container-2] o.s.a.r.l.SimpleMessageListenerContainer : Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused (Connection refused)
2018-06-13T05:54:14.970343+00:00 app[web.1]: 2018-06-13 05:54:14.970 INFO 4 --- [ container-2] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer#362d89d0: tags=[{}], channel=null, acknowledgeMode=AUTO local queue size=0
2018-06-13T05:54:14.971125+00:00 app[web.1]: 2018-06-13 05:54:14.971 INFO 4 --- [ container-3] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
2018-06-13T05:54:14.971946+00:00 app[web.1]: 2018-06-13 05:54:14.971 ERROR 4 --- [ container-3] o.s.a.r.l.SimpleMessageListenerContainer : Failed to check/redeclare auto-delete queue(s).
2018-06-13T05:54:14.971948+00:00 app[web.1]:
2018-06-13T05:54:14.971951+00:00 app[web.1]: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused (Connection refused)
2018-06-13T05:54:14.971952+00:00 app[web.1]: at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971953+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:476) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971956+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:614) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971957+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:240) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971958+00:00 app[web.1]: at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1797) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971959+00:00 app[web.1]: at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1771) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971960+00:00 app[web.1]: at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1752) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971961+00:00 app[web.1]: at org.springframework.amqp.rabbit.core.RabbitAdmin.getQueueProperties(RabbitAdmin.java:338) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971962+00:00 app[web.1]: at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.redeclareElementsIfNecessary(AbstractMessageListenerContainer.java:1604) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971964+00:00 app[web.1]: at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:963) [spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971965+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171-heroku]
2018-06-13T05:54:14.971967+00:00 app[web.1]: Caused by: java.net.ConnectException: Connection refused (Connection refused)
2018-06-13T05:54:14.971969+00:00 app[web.1]: at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:14.971971+00:00 app[web.1]: at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:14.971972+00:00 app[web.1]: at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:14.971973+00:00 app[web.1]: at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:14.971974+00:00 app[web.1]: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:14.971975+00:00 app[web.1]: at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:14.971976+00:00 app[web.1]: at com.rabbitmq.client.impl.SocketFrameHandlerFactory.create(SocketFrameHandlerFactory.java:60) ~[amqp-client-5.1.2.jar!/:5.1.2]
2018-06-13T05:54:14.971977+00:00 app[web.1]: at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:955) ~[amqp-client-5.1.2.jar!/:5.1.2]
2018-06-13T05:54:14.971978+00:00 app[web.1]: at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:907) ~[amqp-client-5.1.2.jar!/:5.1.2]
2018-06-13T05:54:14.971979+00:00 app[web.1]: at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:847) ~[amqp-client-5.1.2.jar!/:5.1.2]
2018-06-13T05:54:14.971980+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:449) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:14.971981+00:00 app[web.1]: ... 9 common frames omitted
2018-06-13T05:54:14.971982+00:00 app[web.1]:
2018-06-13T05:54:14.972042+00:00 app[web.1]: 2018-06-13 05:54:14.971 INFO 4 --- [ container-3] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
2018-06-13T05:54:19.262272+00:00 app[worker.1]: 2018-06-13 05:54:19.261 WARN 4 --- [cTaskExecutor-1] o.s.a.r.l.SimpleMessageListenerContainer : Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused (Connection refused)
2018-06-13T05:54:19.264406+00:00 app[worker.1]: 2018-06-13 05:54:19.264 INFO 4 --- [cTaskExecutor-1] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer#793be5ca: tags=[{}], channel=null, acknowledgeMode=AUTO local queue size=0
2018-06-13T05:54:19.272605+00:00 app[worker.1]: 2018-06-13 05:54:19.272 INFO 4 --- [cTaskExecutor-2] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
2018-06-13T05:54:19.976366+00:00 app[web.1]: 2018-06-13 05:54:19.976 WARN 4 --- [ container-3] o.s.a.r.l.SimpleMessageListenerContainer : Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused (Connection refused)
2018-06-13T05:54:19.976491+00:00 app[web.1]: 2018-06-13 05:54:19.976 INFO 4 --- [ container-3] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer#42d37ed7: tags=[{}], channel=null, acknowledgeMode=AUTO local queue size=0
2018-06-13T05:54:19.977274+00:00 app[web.1]: 2018-06-13 05:54:19.977 INFO 4 --- [ container-4] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
2018-06-13T05:54:19.978248+00:00 app[web.1]: 2018-06-13 05:54:19.978 ERROR 4 --- [ container-4] o.s.a.r.l.SimpleMessageListenerContainer : Failed to check/redeclare auto-delete queue(s).
2018-06-13T05:54:19.978251+00:00 app[web.1]:
2018-06-13T05:54:19.978252+00:00 app[web.1]: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused (Connection refused)
2018-06-13T05:54:19.978253+00:00 app[web.1]: at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978255+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:476) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978256+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:614) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978257+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:240) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978258+00:00 app[web.1]: at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1797) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978259+00:00 app[web.1]: at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1771) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978260+00:00 app[web.1]: at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1752) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978261+00:00 app[web.1]: at org.springframework.amqp.rabbit.core.RabbitAdmin.getQueueProperties(RabbitAdmin.java:338) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978263+00:00 app[web.1]: at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.redeclareElementsIfNecessary(AbstractMessageListenerContainer.java:1604) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978264+00:00 app[web.1]: at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:963) [spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978265+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171-heroku]
2018-06-13T05:54:19.978267+00:00 app[web.1]: Caused by: java.net.ConnectException: Connection refused (Connection refused)
2018-06-13T05:54:19.978268+00:00 app[web.1]: at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:19.978269+00:00 app[web.1]: at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:19.978270+00:00 app[web.1]: at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:19.978271+00:00 app[web.1]: at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:19.978272+00:00 app[web.1]: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:19.978273+00:00 app[web.1]: at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_171-heroku]
2018-06-13T05:54:19.978274+00:00 app[web.1]: at com.rabbitmq.client.impl.SocketFrameHandlerFactory.create(SocketFrameHandlerFactory.java:60) ~[amqp-client-5.1.2.jar!/:5.1.2]
2018-06-13T05:54:19.978275+00:00 app[web.1]: at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:955) ~[amqp-client-5.1.2.jar!/:5.1.2]
2018-06-13T05:54:19.978276+00:00 app[web.1]: at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:907) ~[amqp-client-5.1.2.jar!/:5.1.2]
2018-06-13T05:54:19.978277+00:00 app[web.1]: at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:847) ~[amqp-client-5.1.2.jar!/:5.1.2]
2018-06-13T05:54:19.978278+00:00 app[web.1]: at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:449) ~[spring-rabbit-2.0.3.RELEASE.jar!/:2.0.3.RELEASE]
2018-06-13T05:54:19.978279+00:00 app[web.1]: ... 9 common frames omitted
2018-06-13T05:54:19.978280+00:00 app[web.1]:
2018-06-13T05:54:19.978370+00:00 app[web.1]: 2018-06-13 05:54:19.978 INFO 4 --- [ container-4] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
2018-06-13T05:54:24.281046+00:00 app[worker.1]: 2018-06-13 05:54:24.280 WARN 4 --- [cTaskExecutor-2] o.s.a.r.l.SimpleMessageListenerContainer : Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused (Connection refused)
2018-06-13T05:54:24.281735+00:00 app[worker.1]: 2018-06-13 05:54:24.281 INFO 4 --- [cTaskExecutor-2] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer#7170b3b5: tags=[{}], channel=null, acknowledgeMode=AUTO local queue size=0
2018-06-13T05:54:24.291703+00:00 app[worker.1]: 2018-06-13 05:54:24.291 INFO 4 --- [cTaskExecutor-3] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
Why is it trying to connect to localhost when I have specified host name explicitly in yml file? Any Idea?
Just found out that in yml file I have a profile named as heroku, when I removed it , it connected to the RabbitMQ in the given host.
If you are using spring boot you can configure Rabbit by spring cloud stream.
In this case you dont have to configure the beans and the configuration is much easier:
spring:
#---------------- RabbitMQ -----------------#
rabbitmq:
#Default username ans pass
dynamic: true
host: localhost
port: 5672
username: guest
password: guest
#---------------------------- RabbitMQ properties Commons ------------------------------#
cloud:
stream:
bindings:
springCloudBusInput:
destination: InputExchange
group: Queue
producer:
exchangeAutoDelete: false
springCloudBusOutput:
destination: InputExchange
group: Queue
consumer:
exchangeAutoDelete: false
Then you have to create the listener:
#Component
public class RemoteEventListener implements ApplicationListener<InputEvent> {
#Override
public void onApplicationEvent(InputEvent inputEvent) {
//whatever you want to do when a InputEvent Type is received in the queue
}
}
In this case My app is writing and receiving from the same exchange
and queue (Because of testing so stuff)
If you want to configure rabbit the way you shown, try to create a configuration class with the beans of the queue, exchange and biding with #Configuration. Dont declare the beans in your app class.
It seems it can not read the autodelete property of the queue, but if I'm not wrong I should take the default.
Maybe You have network issues
Check the rabbitmq and restart it
Can you acces to rabbitMq administrator interface?
About the comment about whi is trying to connect with localhost add this to your bean definition:
#Autowired
private ConnectionFactory rabbitConnectionFactory
#Bean
public RabbitTemplate rubeExchangeTemplate() {
RabbitTemplate r = new RabbitTemplate(rabbitConnectionFactory);
r.setExchange("rmq.rube.exchange");
r.setRoutingKey("rube.key");
r.setConnectionFactory(rabbitConnectionFactory);
return r;
}
also remove addresses of your application.yml

deploying play framework 2.4 app to heroku

Hello all i am having some trouble deploying my app to heroku.
i get the following log error when i try to open it.
2015-08-19T17:49:04.031456+00:00 app[web.1]: at com.google.inject.internal.Si
ngleMethodInjector$1.invoke(SingleMethodInjector.java:57)
2015-08-19T17:49:04.031466+00:00 app[web.1]: at com.google.inject.internal.In
itializer.injectAll(Initializer.java:108)
2015-08-19T17:49:04.031447+00:00 app[web.1]: at com.google.inject.internal.In
jectorImpl.callInContext(InjectorImpl.java:1103)
2015-08-19T17:49:04.031462+00:00 app[web.1]: at com.google.inject.internal.In
jectorImpl.callInContext(InjectorImpl.java:1092)
2015-08-19T17:49:04.031238+00:00 app[web.1]: at com.zaxxer.hikari.pool.Hikari
Pool.<init>(HikariPool.java:60)
2015-08-19T17:49:04.031239+00:00 app[web.1]: at com.zaxxer.hikari.pool.Hikari
Pool.<init>(HikariPool.java:48)
2015-08-19T17:49:04.031241+00:00 app[web.1]: at com.zaxxer.hikari.HikariDataS
ource.<init>(HikariDataSource.java:80)
2015-08-19T17:49:04.031242+00:00 app[web.1]: at play.api.db.HikariCPConnectio
nPool$$anonfun$1.apply(HikariCPModule.scala:58)
2015-08-19T17:49:04.031243+00:00 app[web.1]: at play.api.db.HikariCPConnectio
nPool$$anonfun$1.apply(HikariCPModule.scala:54)
2015-08-19T17:49:04.031244+00:00 app[web.1]: at scala.util.Try$.apply(Try.sca
la:191)
2015-08-19T17:49:04.031245+00:00 app[web.1]: at play.api.db.HikariCPConnectio
nPool.create(HikariCPModule.scala:54)
2015-08-19T17:49:04.031247+00:00 app[web.1]: ... 47 more
2015-08-19T17:49:04.031248+00:00 app[web.1]: Caused by: java.sql.SQLException: J
DBC4 Connection.isValid() method not supported, connection test query must be co
nfigured
2015-08-19T17:49:04.031249+00:00 app[web.1]: at com.zaxxer.hikari.pool.BaseHi
kariPool.addConnection(BaseHikariPool.java:441)
2015-08-19T17:49:04.031251+00:00 app[web.1]: at com.zaxxer.hikari.pool.BaseHi
kariPool.initializeConnections(BaseHikariPool.java:540)
2015-08-19T17:49:04.031252+00:00 app[web.1]: ... 55 more
2015-08-19T17:49:04.031253+00:00 app[web.1]:
2015-08-19T17:49:04.031254+00:00 app[web.1]: 2) Error in custom provider, Config
uration error: Configuration error[Cannot connect to database [default]]
2015-08-19T17:49:04.031256+00:00 app[web.1]: while locating play.api.db.DBApiP
rovider
2015-08-19T17:49:04.031257+00:00 app[web.1]: while locating play.api.db.DBApi
2015-08-19T17:49:04.031258+00:00 app[web.1]: for parameter 0 at play.db.Defa
ultDBApi.<init>(DefaultDBApi.java:28)
2015-08-19T17:49:04.031260+00:00 app[web.1]: at play.db.DefaultDBApi.class(Def
aultDBApi.java:28)
2015-08-19T17:49:04.031261+00:00 app[web.1]: while locating play.db.DefaultDBA
pi
2015-08-19T17:49:04.031262+00:00 app[web.1]: while locating play.db.DBApi
2015-08-19T17:49:04.031264+00:00 app[web.1]: for field at play.db.DBModule$N
amedDatabaseProvider.dbApi(DBModule.java:61)
2015-08-19T17:49:04.031265+00:00 app[web.1]: while locating play.db.DBModule$N
amedDatabaseProvider
2015-08-19T17:49:04.031267+00:00 app[web.1]: at com.google.inject.util.Provide
rs$GuicifiedProviderWithDependencies.initialize(Providers.java:149)
2015-08-19T17:49:04.031268+00:00 app[web.1]: at play.db.DBModule.bindings(DBMo
dule.java:40):
2015-08-19T17:49:04.031269+00:00 app[web.1]: Binding(interface play.db.Database
qualified with QualifierInstance(#play.db.NamedDatabase(value=default)) to Provi
derTarget(play.db.DBModule$NamedDatabaseProvider#5cbf9e9f)) (via modules: com.go
ogle.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModule
Conversions$$anon$1)
2015-08-19T17:49:04.031271+00:00 app[web.1]: Caused by: Configuration error: Con
figuration error[Cannot connect to database [default]]
2015-08-19T17:49:04.031272+00:00 app[web.1]: at play.api.Configuration$.confi
gError(Configuration.scala:178)
2015-08-19T17:49:04.031273+00:00 app[web.1]: at play.api.Configuration.report
Error(Configuration.scala:829)
2015-08-19T17:49:04.031274+00:00 app[web.1]: at play.api.db.DefaultDBApi$$ano
nfun$connect$1.apply(DefaultDBApi.scala:48)
2015-08-19T17:49:04.031276+00:00 app[web.1]: at play.api.db.DefaultDBApi$$ano
nfun$connect$1.apply(DefaultDBApi.scala:42)
2015-08-19T17:49:04.031277+00:00 app[web.1]: at scala.collection.immutable.Li
st.foreach(List.scala:381)
2015-08-19T17:49:04.031278+00:00 app[web.1]: at play.api.db.DefaultDBApi.conn
ect(DefaultDBApi.scala:42)
2015-08-19T17:49:04.031280+00:00 app[web.1]: at play.api.db.DBApiProvider.get
$lzycompute(DBModule.scala:72)
2015-08-19T17:49:04.031281+00:00 app[web.1]: at play.api.db.DBApiProvider.get
(DBModule.scala:62)
2015-08-19T17:49:04.031282+00:00 app[web.1]: at play.api.db.DBApiProvider.get
(DBModule.scala:58)
2015-08-19T17:49:04.031283+00:00 app[web.1]: at com.google.inject.internal.Pr
oviderInternalFactory.provision(ProviderInternalFactory.java:81)
2015-08-19T17:49:04.031288+00:00 app[web.1]: at com.google.inject.internal.Bo
undProviderFactory.provision(BoundProviderFactory.java:72)
2015-08-19T17:49:04.031424+00:00 app[web.1]: at com.google.inject.internal.Pr
oviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
2015-08-19T17:49:04.031426+00:00 app[web.1]: at com.google.inject.internal.Bo
undProviderFactory.get(BoundProviderFactory.java:62)
2015-08-19T17:49:04.031450+00:00 app[web.1]: at com.google.inject.internal.Me
mbersInjectorImpl.injectMembers(MembersInjectorImpl.java:62)
2015-08-19T17:49:04.031467+00:00 app[web.1]: at com.google.inject.internal.In
ternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:174)
2015-08-19T17:49:04.031463+00:00 app[web.1]: at com.google.inject.internal.Me
mbersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:80)
2015-08-19T17:49:04.031476+00:00 app[web.1]: at play.api.inject.guice.GuiceAp
plicationLoader.load(GuiceApplicationLoader.scala:21)
2015-08-19T17:49:04.031503+00:00 app[web.1]: at play.api.db.DefaultDatabase.d
ataSource(Databases.scala:122)
2015-08-19T17:49:04.031464+00:00 app[web.1]: at com.google.inject.internal.In
itializer$InjectableReference.get(Initializer.java:174)
2015-08-19T17:49:04.031477+00:00 app[web.1]: at play.core.server.ProdServerSt
art$.start(ProdServerStart.scala:52)
2015-08-19T17:49:04.031505+00:00 app[web.1]: at play.api.db.DefaultDatabase.g
etConnection(Databases.scala:143)
2015-08-19T17:49:04.031468+00:00 app[web.1]: at com.google.inject.internal.In
ternalInjectorCreator.build(InternalInjectorCreator.java:110)
2015-08-19T17:49:04.031491+00:00 app[web.1]: Caused by: Configuration error: Con
figuration error[Exception during pool initialization]
2015-08-19T17:49:04.031509+00:00 app[web.1]: ... 52 more
2015-08-19T17:49:04.031521+00:00 app[web.1]: at play.api.db.HikariCPConnectio
nPool.create(HikariCPModule.scala:54)
2015-08-19T17:49:04.031471+00:00 app[web.1]: at com.google.inject.Guice.creat
eInjector(Guice.java:73)
2015-08-19T17:49:04.031494+00:00 app[web.1]: at play.api.PlayConfig.reportErr
or(Configuration.scala:1048)
2015-08-19T17:49:04.031511+00:00 app[web.1]: at com.zaxxer.hikari.pool.BaseHi
kariPool.initializeConnections(BaseHikariPool.java:542)
2015-08-19T17:49:04.031523+00:00 app[web.1]: Caused by: java.sql.SQLException: J
DBC4 Connection.isValid() method not supported, connection test query must be co
nfigured
2015-08-19T17:49:04.031470+00:00 app[web.1]: at com.google.inject.Guice.creat
eInjector(Guice.java:96)
2015-08-19T17:49:04.031493+00:00 app[web.1]: at play.api.Configuration$.confi
gError(Configuration.scala:178)
2015-08-19T17:49:04.031510+00:00 app[web.1]: Caused by: com.zaxxer.hikari.pool.P
oolInitializationException: Exception during pool initialization
2015-08-19T17:49:04.031522+00:00 app[web.1]: ... 58 more
2015-08-19T17:49:04.031473+00:00 app[web.1]: at play.api.inject.guice.GuiceBu
ilder.injector(GuiceInjectorBuilder.scala:126)
2015-08-19T17:49:04.031501+00:00 app[web.1]: at play.api.db.PooledDatabase.cr
eateDataSource(Databases.scala:199)
2015-08-19T17:49:04.031514+00:00 app[web.1]: at com.zaxxer.hikari.pool.Hikari
Pool.<init>(HikariPool.java:60)
2015-08-19T17:49:04.031526+00:00 app[web.1]: at com.zaxxer.hikari.pool.BaseHi
kariPool.initializeConnections(BaseHikariPool.java:540)
2015-08-19T17:49:04.031478+00:00 app[web.1]: at play.core.server.ProdServerSt
art$.main(ProdServerStart.scala:27)
2015-08-19T17:49:04.031506+00:00 app[web.1]: at play.api.db.DefaultDatabase.g
etConnection(Databases.scala:139)
2015-08-19T17:49:04.031520+00:00 app[web.1]: at scala.util.Try$.apply(Try.sca
la:191)
2015-08-19T17:49:04.031475+00:00 app[web.1]: at play.api.inject.guice.GuiceAp
plicationBuilder.build(GuiceApplicationBuilder.scala:93)
2015-08-19T17:49:04.031502+00:00 app[web.1]: at play.api.db.DefaultDatabase.d
ataSource$lzycompute(Databases.scala:124)
2015-08-19T17:49:04.031515+00:00 app[web.1]: at com.zaxxer.hikari.pool.Hikari
Pool.<init>(HikariPool.java:48)
2015-08-19T17:49:04.031527+00:00 app[web.1]: ... 66 more
2015-08-19T17:49:04.031490+00:00 app[web.1]: at play.core.server.ProdServerSt
art.main(ProdServerStart.scala)
2015-08-19T17:49:04.031507+00:00 app[web.1]: at play.api.db.DefaultDBApi$$ano
nfun$connect$1.apply(DefaultDBApi.scala:44)
2015-08-19T17:49:04.031519+00:00 app[web.1]: at play.api.db.HikariCPConnectio
nPool$$anonfun$1.apply(HikariCPModule.scala:54)
2015-08-19T17:49:04.031459+00:00 app[web.1]: at com.google.inject.internal.Me
mbersInjectorImpl$1.call(MembersInjectorImpl.java:93)
2015-08-19T17:49:04.031472+00:00 app[web.1]: at com.google.inject.Guice.creat
eInjector(Guice.java:62)
2015-08-19T17:49:04.031499+00:00 app[web.1]: at play.api.db.HikariCPConnectio
nPool.create(HikariCPModule.scala:70)
2015-08-19T17:49:04.031513+00:00 app[web.1]: at com.zaxxer.hikari.pool.BaseHi
kariPool.<init>(BaseHikariPool.java:171)
2015-08-19T17:49:04.031525+00:00 app[web.1]: at com.zaxxer.hikari.pool.BaseHi
kariPool.addConnection(BaseHikariPool.java:441)
2015-08-19T17:49:04.031516+00:00 app[web.1]: at com.zaxxer.hikari.HikariDataS
ource.<init>(HikariDataSource.java:80)
2015-08-19T17:49:04.031528+00:00 app[web.1]:
2015-08-19T17:49:04.031791+00:00 app[web.1]: at play.api.inject.guice.GuiceAp
plicationBuilder.build(GuiceApplicationBuilder.scala:93)
2015-08-19T17:49:04.031517+00:00 app[web.1]: at play.api.db.HikariCPConnectio
nPool$$anonfun$1.apply(HikariCPModule.scala:58)
2015-08-19T17:49:04.031529+00:00 app[web.1]: 2 errors
2015-08-19T17:49:04.031534+00:00 app[web.1]: at com.google.inject.internal.In
ternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:176)
2015-08-19T17:49:04.031919+00:00 app[web.1]: at play.core.server.ProdServerSt
art$.main(ProdServerStart.scala:27)
2015-08-19T17:49:04.031625+00:00 app[web.1]: at com.google.inject.Guice.creat
eInjector(Guice.java:96)
2015-08-19T17:49:04.031583+00:00 app[web.1]: at com.google.inject.internal.In
ternalInjectorCreator.build(InternalInjectorCreator.java:110)
2015-08-19T17:49:04.031961+00:00 app[web.1]: at play.core.server.ProdServerSt
art.main(ProdServerStart.scala)
2015-08-19T17:49:04.031744+00:00 app[web.1]: at play.api.inject.guice.GuiceBu
ilder.injector(GuiceInjectorBuilder.scala:126)
2015-08-19T17:49:04.031531+00:00 app[web.1]: at com.google.inject.internal.Er
rors.throwCreationExceptionIfErrorsExist(Errors.java:466)
2015-08-19T17:49:04.031834+00:00 app[web.1]: at play.api.inject.guice.GuiceAp
plicationLoader.load(GuiceApplicationLoader.scala:21)
2015-08-19T17:49:04.031877+00:00 app[web.1]: at play.core.server.ProdServerSt
art$.start(ProdServerStart.scala:52)
2015-08-19T17:49:04.031666+00:00 app[web.1]: at com.google.inject.Guice.creat
eInjector(Guice.java:73)
2015-08-19T17:49:04.031712+00:00 app[web.1]: at com.google.inject.Guice.creat
eInjector(Guice.java:62)
2015-08-19T17:49:04.879998+00:00 heroku[web.1]: State changed from starting to c
rashed
2015-08-19T17:49:04.868064+00:00 heroku[web.1]: Process exited with status 255
2015-08-19T17:49:05.781059+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=artgallerythomasmurphy.herokuapp.com request_id=e
00bff55-eee8-45cf-af1f-7144741d4a87 fwd="99.59.112.230" dyno= connect= service=
status=503 bytes=
So.
here is my application.conf
# This is the main configuration file for the application.
# ~~~~~
# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
#
# This must be changed for production, but we recommend not changing it in this file.
#
# See http://www.playframework.com/documentation/latest/ApplicationSecret for more details.
play.crypto.secret = "changeme"
# The application languages
# ~~~~~
play.i18n.langs = [ "en" ]
# Router
# ~~~~~
# Define the Router object to use for this application.
# This router will be looked up first when the application is starting up,
# so make sure this is the entry point.
# Furthermore, it's assumed your route file is named properly.
# So for an application router like `my.application.Router`,
# you may need to define a router file `conf/my.application.routes`.
# Default to Routes in the root package (and conf/routes)
# play.http.router = my.application.Routes
# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
db.default.driver=org.postgresql.Driver
#db.default.url="jdbc:h2:mem:play"
#db.default.user="Tom"
#db.default.password="160491"
ebean.default = ["model.*"]
# Evolutions
# ~~~~~
# You can disable evolutions if needed
#play.evolutions.enabled=false
# You can disable evolutions for a specific datasource if necessary
# play.evolutions.db.default.enabled=false
Is the error becouse ive commented out some of the variables that my procfile tries to overide?
web: target/universal/stage/bin/artgallery -Dhttp.port=${PORT} -Dplay.evolutions.db.default.autoApply=true -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=${DATABASE_URL}
I also have not touched the database on heroku ive being using the h2 browser to work on the website so far.
Most likely, you need a newer version of the JDBC driver for postgres. Here's one that works:
libraryDependencies ++= Seq(
jdbc,
cache,
"org.postgresql" % "postgresql" % "9.4-1201-jdbc41",
ws
)
And here is a sample app.
This is mentioned fleetingly in the 2.4 migration guide.
Another possibility is that you are using Slick, which recently had a regression in support of Database URL. It will be fixed in 3.0.3, but in the meantime you have to manually turn your DATABASE_URL into a JDBC URL.

neo4j-rest-graphdb causes randomly a 502 bad gateway

Using SDN 3.1.2 and neo4j-rest-graphdb 2.0.1, I come across this exception while saving an entity (frequency 1/5):
2014-11-16T04:54:29.018090+00:00 app[web.1]: [error] play - Cannot invoke the action, eventually got an error: java.lang.RuntimeException: Error reading as JSON '<html><body><h1>502 Bad Gateway</h1>
2014-11-16T04:54:29.018095+00:00 app[web.1]: The server returned an invalid or incomplete response.
2014-11-16T04:54:29.029618+00:00 app[web.1]:
2014-11-16T04:54:29.029620+00:00 app[web.1]: ! #6k83hj7gp - Internal server error, for (POST) [/api/meetings] ->
2014-11-16T04:54:29.018097+00:00 app[web.1]: </body></html>
2014-11-16T04:54:29.029622+00:00 app[web.1]:
2014-11-16T04:54:29.018104+00:00 app[web.1]: '
2014-11-16T04:54:29.029615+00:00 app[web.1]: [error] application -
2014-11-16T04:54:29.029624+00:00 app[web.1]: play.api.Application$$anon$1: Execution exception[[RuntimeException: Error reading as JSON '<html><body><h1>502 Bad Gateway</h1>
2014-11-16T04:54:29.029625+00:00 app[web.1]: The server returned an invalid or incomplete response.
2014-11-16T04:54:29.029627+00:00 app[web.1]: </body></html>
2014-11-16T04:54:29.029630+00:00 app[web.1]: at play.api.Application$class.handleError(Application.scala:293) ~[com.typesafe.play.play_2.10-2.2.3.jar:2.2.3]
2014-11-16T04:54:29.029632+00:00 app[web.1]: at play.api.DefaultApplication.handleError(Application.scala:399) [com.typesafe.play.play_2.10-2.2.3.jar:2.2.3]
2014-11-16T04:54:29.029634+00:00 app[web.1]: at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:264) [com.typesafe.play.play_2.10-2.2.3.jar:2.2.3]
2014-11-16T04:54:29.029628+00:00 app[web.1]: ']]
2014-11-16T04:54:29.029646+00:00 app[web.1]: at org.neo4j.rest.graphdb.util.JsonHelper.readJson(JsonHelper.java:57) ~[org.neo4j.neo4j-rest-graphdb-2.0.1.jar:na]
2014-11-16T04:54:29.029648+00:00 app[web.1]: at org.neo4j.rest.graphdb.util.JsonHelper.jsonToSingleValue(JsonHelper.java:62) ~[org.neo4j.neo4j-rest-graphdb-2.0.1.jar:na]
2014-11-16T04:54:29.029649+00:00 app[web.1]: at org.neo4j.rest.graphdb.RequestResult.toEntity(RequestResult.java:114) ~[org.neo4j.neo4j-rest-graphdb-2.0.1.jar:na]
2014-11-16T04:54:29.029639+00:00 app[web.1]: at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:264) [com.typesafe.play.play_2.10-2.2.3.jar:2.2.3]
2014-11-16T04:54:29.029654+00:00 app[web.1]: at org.neo4j.rest.graphdb.ExecutingRestAPI.getRelationships(ExecutingRestAPI.java:553) ~[org.neo4j.neo4j-rest-graphdb-2.0.1.jar:na]
2014-11-16T04:54:29.029637+00:00 app[web.1]: at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.10.4.jar:na]
2014-11-16T04:54:29.029653+00:00 app[web.1]: at org.neo4j.rest.graphdb.ExecutingRestAPI.wrapRelationships(ExecutingRestAPI.java:383) ~[org.neo4j.neo4j-rest-graphdb-2.0.1.jar:na]
2014-11-16T04:54:29.029640+00:00 app[web.1]: Caused by: java.lang.RuntimeException: Error reading as JSON '<html><body><h1>502 Bad Gateway</h1>
2014-11-16T04:54:29.029655+00:00 app[web.1]: Caused by: org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
2014-11-16T04:54:29.029642+00:00 app[web.1]: The server returned an invalid or incomplete response.
2014-11-16T04:54:29.029657+00:00 app[web.1]: at [Source: java.io.StringReader#78338169; line: 1, column: 2]
2014-11-16T04:54:29.029643+00:00 app[web.1]: </body></html>
2014-11-16T04:54:29.029658+00:00 app[web.1]: at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1433) ~[org.codehaus.jackson.jackson-core-asl-1.9.7.jar:1.9.7]
2014-11-16T04:54:29.029645+00:00 app[web.1]: '
2014-11-16T04:54:29.029660+00:00 app[web.1]: at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521) ~[org.codehaus.jackson.jackson-core-asl-1.9.7.jar:1.9.7]
2014-11-16T04:54:29.029635+00:00 app[web.1]: at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:264) [com.typesafe.play.play_2.10-2.2.3.jar:2.2.3]
2014-11-16T04:54:29.029651+00:00 app[web.1]: at org.neo4j.rest.graphdb.converter.RelationshipIterableConverter.convertFromRepresentation(RelationshipIterableConverter.java:45) ~[org.neo4j.neo4j-rest-graphdb-2.0.1.jar:na]
2014-11-16T04:54:29.029666+00:00 app[web.1]: at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2770) ~[org.codehaus.jackson.jackson-mapper-asl-1.9.7.jar:1.9.7]
2014-11-16T04:54:29.029662+00:00 app[web.1]: at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:442) ~[org.codehaus.jackson.jackson-core-asl-1.9.7.jar:1.9.7]
2014-11-16T04:54:29.029663+00:00 app[web.1]: at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1198) ~[org.codehaus.jackson.jackson-core-asl-1.9.7.jar:1.9.7]
2014-11-16T04:54:29.029665+00:00 app[web.1]: at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:485) ~[org.codehaus.jackson.jackson-core-asl-1.9.7.jar:1.9.7]
Any idea?
It happens since I upgraded to SDN 3.2.1 from 3.1.2.
I'm pointing out that I can simply retry the saving, and the exception disappears...strange.
=> random

Categories