Unable to initialize com.vaadin.flow.spring.VaadinServletContextInitializer$VaadinAppShellContextListener - heroku

I have try to deploy my app to Heroku, but it's not working. I have try to follow the vaadin instructions, but it's not working. What's the problem?
Error on heroku logs:
Exception sending context initialized event to listener instance of class [com.vaadin.flow.spring.VaadinServletContextInitializer$CompositeServletContextListener]
java.lang.RuntimeException: Unable to initialize com.vaadin.flow.spring.VaadinServletContextInitializer$VaadinAppShellContextListener
2023-01-04T22:30:36.972557+00:00 app[web.1]: at com.vaadin.flow.spring.VaadinServletContextInitializer$FailFastServletContextListener.contextInitialized(VaadinServletContextInitializer.java:192) ~[vaadin-spring-23.3.0.jar!/:na]
2023-01-04T22:30:36.972560+00:00 app[web.1]: at com.vaadin.flow.spring.VaadinServletContextInitializer$CompositeServletContextListener.lambda$contextInitialized$0(VaadinServletContextInitializer.java:214) ~[vaadin-spring-23.3.0.jar!/:na]
2023-01-04T22:30:36.972561+00:00 app[web.1]: at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
2023-01-04T22:30:36.972562+00:00 app[web.1]: at com.vaadin.flow.spring.VaadinServletContextInitializer$CompositeServletContextListener.contextInitialized(VaadinServletContextInitializer.java:214) ~[vaadin-spring-23.3.0.jar!/:na]
...
2023-01-04T20:56:40.962495+00:00 app[web.1]: 2023-01-04 21:56:40.962 INFO 4 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 35531 (http)
2023-01-04T20:56:40.981852+00:00 app[web.1]: 2023-01-04 21:56:40.981 INFO 4 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-01-04T20:56:40.982068+00:00 app[web.1]: 2023-01-04 21:56:40.981 INFO 4 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.68]
2023-01-04T20:56:41.145481+00:00 app[web.1]: 2023-01-04 21:56:41.145 INFO 4 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-01-04T20:56:41.145634+00:00 app[web.1]: 2023-01-04 21:56:41.145 INFO 4 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4610 ms
2023-01-04T20:56:41.391728+00:00 app[web.1]: 2023-01-04 21:56:41.391 ERROR 4 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Exception sending context initialized event to listener instance of class [com.vaadin.flow.spring.VaadinServletContextInitializer$CompositeServletContextListener]
2023-01-04T20:56:41.391750+00:00 app[web.1]:
2023-01-04T20:56:41.391753+00:00 app[web.1]: java.lang.RuntimeException: Unable to initialize com.vaadin.flow.spring.VaadinServletContextInitializer$VaadinAppShellContextListener
2023-01-04T20:56:41.391773+00:00 app[web.1]: at com.vaadin.flow.spring.VaadinServletContextInitializer$FailFastServletContextListener.contextInitialized(VaadinServletContextInitializer.java:192) ~[vaadin-spring-23.3.0.jar!/:na]
2023-01-04T20:56:41.391775+00:00 app[web.1]: at com.vaadin.flow.spring.VaadinServletContextInitializer$CompositeServletContextListener.lambda$contextInitialized$0(VaadinServletContextInitializer.java:214) ~[vaadin-spring-23.3.0.jar!/:na]
2023-01-04T20:56:41.391776+00:00 app[web.1]: at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
2023-01-04T20:56:41.391776+00:00 app[web.1]: at com.vaadin.flow.spring.VaadinServletContextInitializer$CompositeServletContextListener.contextInitialized(VaadinServletContextInitializer.java:214) ~[vaadin-spring-23.3.0.jar!/:na]
2023-01-04T20:56:41.391778+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4767) ~[tomcat-embed-core-9.0.68.jar!/:na]
2023-01-04T20:56:41.391778+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5231) ~[tomcat-embed-core-9.0.68.jar!/:na]
2023-01-04T20:56:41.391779+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.68.jar!/:na]
2023-01-04T20:56:41.391779+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.68.jar!/:na]
2023-01-04T20:56:41.391780+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.68.jar!/:na]
...
2023-01-04T20:56:41.391815+00:00 app[web.1]: ... 50 common frames omitted
2023-01-04T20:56:41.391815+00:00 app[web.1]:
2023-01-04T20:56:41.392195+00:00 app[web.1]: 2023-01-04 21:56:41.392 ERROR 4 --- [ main] o.apache.catalina.core.StandardContext : One or more listeners failed to start. Full details will be found in the appropriate container log file
2023-01-04T20:56:41.392932+00:00 app[web.1]: 2023-01-04 21:56:41.392 ERROR 4 --- [ main] o.apache.catalina.core.StandardContext : Context [] startup failed due to previous errors
2023-01-04T20:56:41.446993+00:00 app[web.1]: 2023-01-04 21:56:41.446 INFO 4 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2023-01-04T20:56:41.452376+00:00 app[web.1]: 2023-01-04 21:56:41.452 WARN 4 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2023-01-04T20:56:41.464604+00:00 app[web.1]: 2023-01-04 21:56:41.464 INFO 4 --- [ main] ConditionEvaluationReportLoggingListener :
2023-01-04T20:56:41.464605+00:00 app[web.1]:
2023-01-04T20:56:41.464606+00:00 app[web.1]: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-01-04T20:56:41.509555+00:00 app[web.1]: 2023-01-04 21:56:41.509 ERROR 4 --- [ main] o.s.boot.SpringApplication : Application run failed
...
2023-01-04T20:56:41.509566+00:00 app[web.1]: Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2023-01-04T20:56:41.509566+00:00 app[web.1]: at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142) ~[spring-boot-2.7.5.jar!/:2.7.5]
2023-01-04T20:56:41.509566+00:00 app[web.1]: at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104) ~[spring-boot-2.7.5.jar!/:2.7.5]
2023-01-04T20:56:41.509567+00:00 app[web.1]: at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:479) ~[spring-boot-2.7.5.jar!/:2.7.5]
2023-01-04T20:56:41.509567+00:00 app[web.1]: at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211) ~[spring-boot-2.7.5.jar!/:2.7.5]
2023-01-04T20:56:41.509568+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:184) ~[spring-boot-2.7.5.jar!/:2.7.5]
2023-01-04T20:56:41.509568+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.7.5.jar!/:2.7.5]
2023-01-04T20:56:41.509569+00:00 app[web.1]: ... 17 common frames omitted
2023-01-04T20:56:41.509569+00:00 app[web.1]: Caused by: java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[] failed to start
2023-01-04T20:56:41.509570+00:00 app[web.1]: at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.rethrowDeferredStartupExceptions(TomcatWebServer.java:187) ~[spring-boot-2.7.5.jar!/:2.7.5]
2023-01-04T20:56:41.509570+00:00 app[web.1]: at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:126) ~[spring-boot-2.7.5.jar!/:2.7.5]
2023-01-04T20:56:41.509570+00:00 app[web.1]: ... 22 common frames omitted
2023-01-04T20:56:41.509571+00:00 app[web.1]:
2023-01-04T20:56:41.752738+00:00 heroku[web.1]: State changed from starting to crashed
On my computer is working perfectly and i don't receive any error message.

Related

Spring boot with embeded tomcat on AWS is start to fail

I was able to start it properly with same configuration and port, however suddenly its unable to start with below log. As per the log, its a Caused by: java.net.SocketException: Permission denied
However I am surprised that nothing has changed then how suddenly I am getting permission denied, not getting any further clue, can someone suggest please
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.7.RELEASE)
2021-02-03 10:09:32.282 INFO 26951 --- [ main] c.p.w.e.WebhookEndpointApplication : Starting WebhookEndpointApplication v1.0.0 on ip-172-31-2
6-225.eu-central-1.compute.internal with PID 26951 (/home/ec2-user/webhook-app/webhook-endpoint/target/webhook-endpoint-1.0.0.jar started by ec2-user in /home
/ec2-user/webhook-app/webhook-endpoint)
2021-02-03 10:09:32.286 INFO 26951 --- [ main] c.p.w.e.WebhookEndpointApplication : No active profile set, falling back to default profiles:
default
2021-02-03 10:09:33.424 INFO 26951 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data MongoDB repositories in DEFAULT
mode.
2021-02-03 10:09:33.504 INFO 26951 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 72ms. Found 1
MongoDB repository interfaces.
2021-02-03 10:09:34.267 INFO 26951 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 80 (http)
2021-02-03 10:09:34.283 INFO 26951 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-02-03 10:09:34.284 INFO 26951 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.34]
2021-02-03 10:09:34.412 INFO 26951 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-02-03 10:09:34.412 INFO 26951 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2
017 ms
2021-02-03 10:09:34.756 INFO 26951 --- [ main] org.mongodb.driver.cluster : Cluster created with settings {hosts=[localhost:27017], m
ode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
2021-02-03 10:09:34.981 INFO 26951 --- [localhost:27017] org.mongodb.driver.connection : Opened connection [connectionId{localValue:1, serverValue
:11}] to localhost:27017
2021-02-03 10:09:34.990 INFO 26951 --- [localhost:27017] org.mongodb.driver.cluster : Monitor thread successfully connected to server with desc
ription ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[4, 2, 8]}, minWireVersion=0,
maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=6701667}
2021-02-03 10:09:35.550 INFO 26951 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-02-03 10:09:35.793 INFO 26951 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-02-03 10:09:35.802 INFO 26951 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-02-03 10:09:35.808 ERROR 26951 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:212) ~[spring-boot-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297) ~[sprin
g-boot-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163) ~[spring
-boot-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) ~[spring-context-5.2.6.RELEASE.jar!/:5.
2.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-
2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
at com.payon.webhook.endpoint.WebhookEndpointApplication.main(WebhookEndpointApplication.java:10) [classes!/:1.0.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_252]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_252]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_252]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_252]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [webhook-endpoint-1.0.0.jar:1.0.0]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [webhook-endpoint-1.0.0.jar:1.0.0]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [webhook-endpoint-1.0.0.jar:1.0.0]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [webhook-endpoint-1.0.0.jar:1.0.0]
Caused by: java.lang.IllegalArgumentException: standardService.connector.startFailed
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:231) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:265) ~[spring-boot-2.2.7.RELEASE.j
ar!/:2.2.7.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:196) ~[spring-boot-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
... 18 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1066) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:227) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
... 20 common frames omitted
Caused by: java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_252]
at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_252]
at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_252]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:220) ~[na:1.8.0_252]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85) ~[na:1.8.0_252]
at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:228) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:211) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1141) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1227) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:592) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1063) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
... 22 common frames omitted
You can look at this answer: Spring Boot deploy with Tomcat.
In my case; i included the tomcat dependency in the pom file;and I use 8080 as the server pot; which solves my issue.
In addition, don't forget to check your jre and jdk version.

"BeanDefinitionStoreException: Failed to process import candidates for configuration class" when deploying a JHipster monolithic app to Heroku

I've never deployed any sort of JVM web app before so I really have no idea what's going on. From the Heroku log, the error looks to be the following:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [tld.domain.webapp.FinancialServicesStationApp]; nested exception is java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration**
I am using MariaDB as my database, Gradle for building and the backend is written in kotlin. I used the option to compile the source code on my own machine, which I think should have worked since I can run the site in development mode just fine. Does someone know what could be causing this error and how I can fix it?
This is the full JHipster log:
2020-11-04T01:52:33.805989+00:00 app[web.1]: 2020-11-04 01:52:33.801 INFO 4 --- [ main] .f.FinancialServicesStationApp$Companion : The following profiles are active: prod,heroku
2020-11-04T01:52:35.007983+00:00 app[web.1]: 2020-11-04 01:52:35.007 WARN 4 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [tld.domain.webapp.FinancialServicesStationApp]; nested exception is java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration
2020-11-04T01:52:35.025845+00:00 app[web.1]: 2020-11-04 01:52:35.025 ERROR 4 --- [ main] o.s.boot.SpringApplication : Application run failed
2020-11-04T01:52:35.025847+00:00 app[web.1]:
2020-11-04T01:52:35.025849+00:00 app[web.1]: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [tld.domain.webapp.FinancialServicesStationApp]; nested exception is java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration
2020-11-04T01:52:35.025850+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:609)
2020-11-04T01:52:35.025851+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.access$800(ConfigurationClassParser.java:110)
2020-11-04T01:52:35.025852+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:811)
2020-11-04T01:52:35.025853+00:00 app[web.1]: at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2020-11-04T01:52:35.025854+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:808)
2020-11-04T01:52:35.025854+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:779)
2020-11-04T01:52:35.025856+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:192)
2020-11-04T01:52:35.025856+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:319)
2020-11-04T01:52:35.025857+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236)
2020-11-04T01:52:35.025857+00:00 app[web.1]: at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
2020-11-04T01:52:35.025858+00:00 app[web.1]: at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
2020-11-04T01:52:35.025858+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706)
2020-11-04T01:52:35.025859+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
2020-11-04T01:52:35.025859+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
2020-11-04T01:52:35.025860+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
2020-11-04T01:52:35.025861+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
2020-11-04T01:52:35.025862+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
2020-11-04T01:52:35.025863+00:00 app[web.1]: at tld.domain.webapp.FinancialServicesStationApp$Companion.main(FinancialServicesStationApp.kt:105)
2020-11-04T01:52:35.025863+00:00 app[web.1]: at tld.domain.webapp.FinancialServicesStationApp.main(FinancialServicesStationApp.kt)
2020-11-04T01:52:35.025863+00:00 app[web.1]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2020-11-04T01:52:35.025864+00:00 app[web.1]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2020-11-04T01:52:35.025864+00:00 app[web.1]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2020-11-04T01:52:35.025865+00:00 app[web.1]: at java.base/java.lang.reflect.Method.invoke(Method.java:564)
2020-11-04T01:52:35.025865+00:00 app[web.1]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
2020-11-04T01:52:35.025866+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
2020-11-04T01:52:35.025866+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
2020-11-04T01:52:35.025866+00:00 app[web.1]: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
2020-11-04T01:52:35.025867+00:00 app[web.1]: Caused by: java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseConfiguration
2020-11-04T01:52:35.025867+00:00 app[web.1]: at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60)
2020-11-04T01:52:35.025868+00:00 app[web.1]: at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
2020-11-04T01:52:35.025868+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:225)
2020-11-04T01:52:35.025877+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processMemberClasses(ConfigurationClassParser.java:371)
2020-11-04T01:52:35.025878+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:271)
2020-11-04T01:52:35.025878+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:249)
2020-11-04T01:52:35.025879+00:00 app[web.1]: at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:599)
2020-11-04T01:52:35.025879+00:00 app[web.1]: ... 26 common frames omitted
2020-11-04T01:52:35.025880+00:00 app[web.1]: Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'JDBC_DATABASE_URL' in value "${JDBC_DATABASE_URL}"
2020-11-04T01:52:35.025880+00:00 app[web.1]: at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:178)
2020-11-04T01:52:35.025880+00:00 app[web.1]: at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124)
2020-11-04T01:52:35.025881+00:00 app[web.1]: at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:236)
2020-11-04T01:52:35.025881+00:00 app[web.1]: at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210)
2020-11-04T01:52:35.025882+00:00 app[web.1]: at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:227)
2020-11-04T01:52:35.025882+00:00 app[web.1]: at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:88)
2020-11-04T01:52:35.025883+00:00 app[web.1]: at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:62)
2020-11-04T01:52:35.025883+00:00 app[web.1]: at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:535)
2020-11-04T01:52:35.025884+00:00 app[web.1]: at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$EmbeddedDatabaseCondition.getMatchOutcome(DataSourceAutoConfiguration.java:126)
2020-11-04T01:52:35.025884+00:00 app[web.1]: at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
2020-11-04T01:52:35.025884+00:00 app[web.1]: ... 32 common frames omitted
2020-11-04T01:52:35.025885+00:00 app[web.1]:
2020-11-04T01:52:35.104335+00:00 heroku[web.1]: Process exited with status 1
2020-11-04T01:52:35.142760+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-04T01:55:15.000000+00:00 app[api]: Build failed -- check your build output:
The important part of the error is:
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'JDBC_DATABASE_URL' in value "${JDBC_DATABASE_URL}"
Heroku deployment could not inject the database properties into your application context and so it fails to start.
So, maybe you did not subscribe to jawsdb add-on or your did not register a payment method. There are few similar questions about this on stackoverflow
I suppose that you deployed using jhipster heroku as described in the doc: https://www.jhipster.tech/heroku/

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.<SpringBoot>

I'm starting with SpringBoot and I have to do a HelloWold but enable SSL. I run my program and I got the following result:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-17 00:01:26.780 ERROR 20620 --- [ main] o.s.boot.SpringApplication : Application run failed
Could anyone help me to resolve that?
PROPERTIES:
server.port=8443
server.ssl.enabled=true
server.ssl.key-store= src/main/resources/bootsecurity.p12
server.ssl.key-password=security
server.ssl.key-store-type=PKCS12
server.ssl.key-alias=bootsecurity
MAIN:
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
#RestController
public class DemoController {
#RequestMapping("getData")
public String demo() {
return "Hello SSL";
}
}
FULL STACK TRACE:
2020-06-17 01:35:10.278 INFO 5524 --- [ main] c.example.demo.DemoSslSpringApplication : Starting DemoSslSpringApplication on LAPTOP-EIJJNNJC with PID 5524 (C:\Users\12345\Documents\workspace-spring-tool-suite-4-4.6.2.RELEASE\DemoSSLSpring\target\classes started by Adrian in C:\Users\12345\Documents\workspace-spring-tool-suite-4-4.6.2.RELEASE\DemoSSLSpring)
2020-06-17 01:35:10.282 INFO 5524 --- [ main] c.example.demo.DemoSslSpringApplication : No active profile set, falling back to default profiles: default
2020-06-17 01:35:11.537 INFO 5524 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8443 (https)
2020-06-17 01:35:11.552 INFO 5524 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-06-17 01:35:11.552 INFO 5524 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.36]
2020-06-17 01:35:11.732 INFO 5524 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-06-17 01:35:11.732 INFO 5524 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1382 ms
2020-06-17 01:35:12.013 INFO 5524 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-06-17 01:35:13.125 WARN 5524 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
2020-06-17 01:35:13.126 INFO 5524 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2020-06-17 01:35:13.131 INFO 5524 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-06-17 01:35:13.156 INFO 5524 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-17 01:35:13.178 ERROR 5524 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at com.example.demo.DemoSslSpringApplication.main(DemoSslSpringApplication.java:10) ~[classes/:na]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:229) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
... 14 common frames omitted
Caused by: java.lang.IllegalArgumentException: standardService.connector.startFailed
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:231) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:282) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:213) ~[spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
... 16 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1067) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:227) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
... 18 common frames omitted
Caused by: java.lang.IllegalArgumentException: Private key must be accompanied by certificate chain
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:99) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:71) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:216) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1141) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1227) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:592) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1064) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
... 20 common frames omitted
Caused by: java.lang.IllegalArgumentException: Private key must be accompanied by certificate chain
at java.base/java.security.KeyStore.setKeyEntry(KeyStore.java:1163) ~[na:na]
at org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:355) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:246) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:97) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
... 26 common frames omitted
I tried to fix it but I continue with the same error. I hope someone can help me, I've really been looking to take this away for a little while now. I've done it again in different ways but it's always the same or I present different mistakes.
Add logging.level.<your-package-name>=DEBUG in your application.properties file
like logging.level.com.example=DEBUG -> using this you can enable DEBUGGING in your project
Also, try to change the port of your localhost maybe the port was already assigned
server.port=8080
I had the same problem. To fix it, In application.properties (at src/main/resources) file add the property to change the port number: server.port=8180
I hope it can help you too.
In pom file change the scope to runtime from test
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
Well, an error in starting the AppContext can have many reasons. Is this the full stacktrace?
Concerning your demo controller, a Slash '/' is missing at the path and the controller has none. Maybe that fixes it, but can't say without full stacktrace.
#RestController("/demo") //<like this
public class DemoController {
#RequestMapping("/getData") //<-like this
public String demo() {
return "Hello SSL";
}
}
Try to change the version . I got solution by this
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

SpringBoot crashes after deployment of war, on launching in heroku

I'm trying to deploy my springboot application in heroku. This application contains a spriboot back end and ionic framework for front end. All these are packaged in a war file, which is being deployed successfully in my local tomcat and also it works like a charm. When I try to deploy this on heroku, on deploying the Springboot it crashes with the following error:
2019-06-02T10:14:27.864513+00:00 app[web.1]: :: Spring Boot ::
(v2.1.5.RELEASE) 2019-06-02T10:14:27.864559+00:00 app[web.1]:
2019-06-02T10:14:28.086513+00:00 app[web.1]: 2019-06-02 10:14:28.081
INFO 4 --- [ost-startStop-1] c.m.g.movierama.MovieramaApplication
: Starting MovieramaApplication v0.0.1-SNAPSHOT on
5afc3cd9-f86f-466f-9b86-9f66bc5beae7 with PID 4
(/app/target/tomcat.12290/webapps/expanded/WEB-INF/classes started by
u40978 in /app) 2019-06-02T10:14:28.088166+00:00 app[web.1]:
2019-06-02 10:14:28.087 INFO 4 --- [ost-startStop-1]
c.m.g.movierama.MovieramaApplication : No active profile set,
falling back to default profiles: default
2019-06-02T10:14:29.523921+00:00 app[web.1]: 2019-06-02 10:14:29.521
INFO 4 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate
: Bootstrapping Spring Data repositories in DEFAULT mode.
2019-06-02T10:14:29.562415+00:00 app[web.1]: 2019-06-02 10:14:29.562
INFO 4 --- [ost-startStop-1] .s.d.r.c.RepositoryConfigurationDelegate
: Finished Spring Data repository scanning in 26ms. Found 0 repository
interfaces. 2019-06-02T10:14:30.060948+00:00 app[web.1]: 2019-06-02
10:14:30.060 INFO 4 --- [ost-startStop-1]
faultConfiguringBeanFactoryPostProcessor : No bean named
'errorChannel' has been explicitly defined. Therefore, a default
PublishSubscribeChannel will be created.
2019-06-02T10:14:30.068963+00:00 app[web.1]: 2019-06-02 10:14:30.068
INFO 4 --- [ost-startStop-1] faultConfiguringBeanFactoryPostProcessor
: No bean named 'taskScheduler' has been explicitly defined.
Therefore, a default ThreadPoolTaskScheduler will be created.
2019-06-02T10:14:30.075260+00:00 app[web.1]: 2019-06-02 10:14:30.075
INFO 4 --- [ost-startStop-1] faultConfiguringBeanFactoryPostProcessor
: No bean named 'integrationHeaderChannelRegistry' has been explicitly
defined. Therefore, a default DefaultHeaderChannelRegistry will be
created. 2019-06-02T10:14:30.287747+00:00 app[web.1]: 2019-06-02
10:14:30.287 INFO 4 --- [ost-startStop-1]
trationDelegate$BeanPostProcessorChecker : Bean
'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration'
of type
[org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$c5e20e2a]
is not eligible for getting processed by all BeanPostProcessors (for
example: not eligible for auto-proxying)
2019-06-02T10:14:30.363779+00:00 app[web.1]: 2019-06-02 10:14:30.363
INFO 4 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker
: Bean
'org.springframework.integration.config.IntegrationManagementConfiguration'
of type
[org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$30d3c959]
is not eligible for getting processed by all BeanPostProcessors (for
example: not eligible for auto-proxying)
2019-06-02T10:14:30.399455+00:00 app[web.1]: 2019-06-02 10:14:30.399
INFO 4 --- [ost-startStop-1] trationDelegate$BeanPostProcessorChecker
: Bean 'integrationDisposableAutoCreatedBeans' of type
[org.springframework.integration.config.annotation.Disposables] is not
eligible for getting processed by all BeanPostProcessors (for example:
not eligible for auto-proxying) 2019-06-02T10:14:30.471157+00:00
app[web.1]: 2019-06-02 10:14:30.470 INFO 4 --- [ost-startStop-1]
o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring
embedded WebApplicationContext 2019-06-02T10:14:30.471413+00:00
app[web.1]: 2019-06-02 10:14:30.471 INFO 4 --- [ost-startStop-1]
o.s.web.context.ContextLoader : Root WebApplicationContext:
initialization completed in 2334 ms 2019-06-02T10:14:31.100545+00:00
app[web.1]: 2019-06-02 10:14:31.100 INFO 4 --- [ost-startStop-1]
com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2019-06-02T10:14:31.767558+00:00 app[web.1]: 2019-06-02 10:14:31.767
INFO 4 --- [ost-startStop-1] com.zaxxer.hikari.HikariDataSource
: HikariPool-1 - Start completed. 2019-06-02T10:14:31.942093+00:00
app[web.1]: 2019-06-02 10:14:31.940 INFO 4 --- [ost-startStop-1]
o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing
PersistenceUnitInfo [ 2019-06-02T10:14:31.942096+00:00 app[web.1]:
name: default 2019-06-02T10:14:31.942098+00:00 app[web.1]: ...]
2019-06-02T10:14:32.216822+00:00 app[web.1]: 2019-06-02 10:14:32.216
INFO 4 --- [ost-startStop-1] org.hibernate.Version
: HHH000412: Hibernate Core {5.3.10.Final}
2019-06-02T10:14:32.223817+00:00 app[web.1]: 2019-06-02 10:14:32.223
INFO 4 --- [ost-startStop-1] org.hibernate.cfg.Environment
: HHH000206: hibernate.properties not found
2019-06-02T10:14:32.694566+00:00 app[web.1]: 2019-06-02 10:14:32.694
INFO 4 --- [ost-startStop-1] o.hibernate.annotations.common.Version
: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2019-06-02T10:14:33.118437+00:00 app[web.1]: 2019-06-02 10:14:33.118
INFO 4 --- [ost-startStop-1] org.hibernate.dialect.Dialect
: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2019-06-02T10:14:34.600268+00:00 app[web.1]: 2019-06-02 10:14:34.599
INFO 4 --- [ost-startStop-1] j.LocalContainerEntityManagerFactoryBean
: Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-06-02T10:14:35.687724+00:00 heroku[web.1]: State changed from up
to crashed 2019-06-02T10:14:35.405611+00:00 app[web.1]: 2019-06-02
10:14:35.405 WARN 4 --- [ost-startStop-1]
ConfigServletWebServerApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'requestMappingHandlerAdapter' defined in
class path resource
[org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]:
Factory method 'requestMappingHandlerAdapter' threw exception; nested
exception is java.lang.BootstrapMethodError:
java.lang.IllegalAccessError: no such method:
io.reactivex.Flowable.fromPublisher(Publisher)Flowable/invokeStatic
2019-06-02T10:14:35.409906+00:00 app[web.1]: 2019-06-02 10:14:35.408
INFO 4 --- [ost-startStop-1] j.LocalContainerEntityManagerFactoryBean
: Closing JPA EntityManagerFactory for persistence unit 'default'
2019-06-02T10:14:35.415771+00:00 app[web.1]: 2019-06-02 10:14:35.415
INFO 4 --- [ost-startStop-1] com.zaxxer.hikari.HikariDataSource
: HikariPool-1 - Shutdown initiated...
2019-06-02T10:14:35.449333+00:00 app[web.1]: 2019-06-02 10:14:35.449
INFO 4 --- [ost-startStop-1] com.zaxxer.hikari.HikariDataSource
: HikariPool-1 - Shutdown completed. 2019-06-02T10:14:35.460889+00:00
app[web.1]: 2019-06-02 10:14:35.460 INFO 4 --- [ost-startStop-1]
ConditionEvaluationReportLoggingListener :
2019-06-02T10:14:35.460892+00:00 app[web.1]:
2019-06-02T10:14:35.460894+00:00 app[web.1]: Error starting
ApplicationContext. To display the conditions report re-run your
application with 'debug' enabled. 2019-06-02T10:14:35.470103+00:00
app[web.1]: 2019-06-02 10:14:35.469 ERROR 4 --- [ost-startStop-1]
o.s.boot.SpringApplication : Application run failed
2019-06-02T10:14:35.470106+00:00 app[web.1]:
2019-06-02T10:14:35.470111+00:00 app[web.1]:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'requestMappingHandlerAdapter' defined in
class path resource
[org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]:
Factory method 'requestMappingHandlerAdapter' threw exception; nested
exception is java.lang.BootstrapMethodError:
java.lang.IllegalAccessError: no such method:
io.reactivex.Flowable.fromPublisher(Publisher)Flowable/invokeStatic
2019-06-02T10:14:35.470113+00:00 app[web.1]: at
org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470114+00:00 app[web.1]: at
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470117+00:00 app[web.1]: at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470118+00:00 app[web.1]: at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470124+00:00 app[web.1]: at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470125+00:00 app[web.1]: at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470127+00:00 app[web.1]: at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470128+00:00 app[web.1]: at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470129+00:00 app[web.1]: at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470131+00:00 app[web.1]: at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470132+00:00 app[web.1]: at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:843)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470133+00:00 app[web.1]: at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470135+00:00 app[web.1]: at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470136+00:00 app[web.1]: at
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470138+00:00 app[web.1]: at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470139+00:00 app[web.1]: at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470141+00:00 app[web.1]: at
org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470142+00:00 app[web.1]: at
org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:157)
[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470143+00:00 app[web.1]: at
org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:137)
[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470150+00:00 app[web.1]: at
org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91)
[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470151+00:00 app[web.1]: at
org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
[spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470153+00:00 app[web.1]: at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5272)
[webapp-runner.jar:na] 2019-06-02T10:14:35.470155+00:00 app[web.1]: at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
[webapp-runner.jar:na] 2019-06-02T10:14:35.470156+00:00 app[web.1]: at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
[webapp-runner.jar:na] 2019-06-02T10:14:35.470157+00:00 app[web.1]: at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
[webapp-runner.jar:na] 2019-06-02T10:14:35.470159+00:00 app[web.1]: at
java.util.concurrent.FutureTask.run(FutureTask.java:266)
[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470160+00:00 app[web.1]: at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470161+00:00 app[web.1]: at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470163+00:00 app[web.1]: at
java.lang.Thread.run(Thread.java:748) [na:1.8.0_212-heroku]
2019-06-02T10:14:35.470167+00:00 app[web.1]: Caused by:
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]:
Factory method 'requestMappingHandlerAdapter' threw exception; nested
exception is java.lang.BootstrapMethodError:
java.lang.IllegalAccessError: no such method:
io.reactivex.Flowable.fromPublisher(Publisher)Flowable/invokeStatic
2019-06-02T10:14:35.470169+00:00 app[web.1]: at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470171+00:00 app[web.1]: at
org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470173+00:00 app[web.1]: ... 28 common frames
omitted 2019-06-02T10:14:35.470174+00:00 app[web.1]: Caused by:
java.lang.BootstrapMethodError: java.lang.IllegalAccessError: no such
method:
io.reactivex.Flowable.fromPublisher(Publisher)Flowable/invokeStatic
2019-06-02T10:14:35.470176+00:00 app[web.1]: at
org.springframework.core.ReactiveAdapterRegistry$RxJava2Registrar.registerAdapters(ReactiveAdapterRegistry.java:248)
~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470177+00:00 app[web.1]: at
org.springframework.core.ReactiveAdapterRegistry.(ReactiveAdapterRegistry.java:83)
~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470178+00:00 app[web.1]: at
org.springframework.core.ReactiveAdapterRegistry.getSharedInstance(ReactiveAdapterRegistry.java:179)
~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470180+00:00 app[web.1]: at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.(RequestMappingHandlerAdapter.java:168)
~[spring-webmvc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470181+00:00 app[web.1]: at
org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.createRequestMappingHandlerAdapter(WebMvcConfigurationSupport.java:593)
~[spring-webmvc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470185+00:00 app[web.1]: at
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration.createRequestMappingHandlerAdapter(WebMvcAutoConfiguration.java:496)
~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470186+00:00 app[web.1]: at
org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.requestMappingHandlerAdapter(WebMvcConfigurationSupport.java:561)
~[spring-webmvc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470188+00:00 app[web.1]: at
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration.requestMappingHandlerAdapter(WebMvcAutoConfiguration.java:484)
~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470205+00:00 app[web.1]: at
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$30cf5eaa.CGLIB$requestMappingHandlerAdapter$7()
~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470206+00:00 app[web.1]: at
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$30cf5eaa$$FastClassBySpringCGLIB$$5e7c894e.invoke()
~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470213+00:00 app[web.1]: at
org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470214+00:00 app[web.1]: at
org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470216+00:00 app[web.1]: at
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration$$EnhancerBySpringCGLIB$$30cf5eaa.requestMappingHandlerAdapter()
~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE]
2019-06-02T10:14:35.470217+00:00 app[web.1]: at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470219+00:00 app[web.1]: at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470220+00:00 app[web.1]: at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470222+00:00 app[web.1]: at
java.lang.reflect.Method.invoke(Method.java:498)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470223+00:00 app[web.1]: at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE]
2019-06-02T10:14:35.470224+00:00 app[web.1]: ... 29 common frames
omitted 2019-06-02T10:14:35.470226+00:00 app[web.1]: Caused by:
java.lang.IllegalAccessError: no such method:
io.reactivex.Flowable.fromPublisher(Publisher)Flowable/invokeStatic
2019-06-02T10:14:35.470227+00:00 app[web.1]: at
java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:483)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470228+00:00 app[web.1]:
... 47 common frames omitted 2019-06-02T10:14:35.470231+00:00
app[web.1]: Caused by: java.lang.LinkageError: loader constraint
violation: when resolving method
"io.reactivex.Flowable.fromPublisher(Lorg/reactivestreams/Publisher;)Lio/reactivex/Flowable;"
the class loader (instance of
org/apache/catalina/loader/ParallelWebappClassLoader) of the current
class,
org/springframework/core/ReactiveAdapterRegistry$RxJava2Registrar, and
the class loader (instance of sun/misc/Launcher$AppClassLoader) for
the method's defining class, io/reactivex/Flowable, have different
Class objects for the type org/reactivestreams/Publisher used in the
signature 2019-06-02T10:14:35.470232+00:00 app[web.1]: at
java.lang.invoke.MethodHandleNatives.resolve(Native Method)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470234+00:00 app[web.1]: at
java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470235+00:00 app[web.1]: at
java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470236+00:00 app[web.1]: at
java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1394)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470238+00:00 app[web.1]: at
java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1750)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470239+00:00 app[web.1]: at
java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
~[na:1.8.0_212-heroku] 2019-06-02T10:14:35.470240+00:00 app[web.1]:
... 47 common frames omitted

RabbitMQ how to stop reconnecting after AmqpIOException UnknownHostException

for our integration-test profile we want to disable Spring's automatic reconnecting to fail fast.
Attempting to connect to: [rabbitmq-invalid-host:5672]
Error creating consumer; retrying in 5000
org.springframework.amqp.AmqpConnectException: org.springframework.amqp.AmqpIOException: java.net.UnknownHostException: rabbitmq-invalid-host
the following settings do not have any effect yet:
spring.rabbitmq.connection-timeout=1000
spring.rabbitmq.requested-heartbeat=1
spring.rabbitmq.listener.direct.missing-queues-fatal=true
spring.rabbitmq.listener.direct.retry.enabled=false
spring.rabbitmq.template.retry.enabled=false
any idea how to make amqp give up or even destroy the whole app-context?
full stacktrace:
2019-06-11 14:56:31.596 INFO 3025 --- [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [rabbitmq-invalid-host:5672]
2019-06-11 14:56:31.698 INFO 3025 --- [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [rabbitmq-invalid-host:5672]
2019-06-11 14:56:31.902 INFO 3025 --- [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [rabbitmq-invalid-host:5672]
2019-06-11 14:56:32.305 INFO 3025 --- [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [rabbitmq-invalid-host:5672]
2019-06-11 14:56:33.108 INFO 3025 --- [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [rabbitmq-invalid-host:5672]
2019-06-11 14:56:34.709 INFO 3025 --- [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [rabbitmq-invalid-host:5672]
2019-06-11 14:56:36.476 INFO 3025 --- [ntContainer#0-1] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [rabbitmq-invalid-host:5672]
2019-06-11 14:56:36.477 ERROR 3025 --- [ntContainer#0-1] o.s.a.r.l.DirectMessageListenerContainer : Error creating consumer; retrying in 5000
org.springframework.amqp.AmqpConnectException: org.springframework.amqp.AmqpIOException: java.net.UnknownHostException: rabbitmq-invalid-host
at org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer.doConsumeFromQueue(DirectMessageListenerContainer.java:667) [spring-rabbit-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer.consumeFromQueue(DirectMessageListenerContainer.java:645) [spring-rabbit-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer.startConsumers(DirectMessageListenerContainer.java:550) [spring-rabbit-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer.lambda$actualStart$1(DirectMessageListenerContainer.java:410) [spring-rabbit-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_212]
Caused by: org.springframework.amqp.AmqpIOException: java.net.UnknownHostException: rabbitmq-invalid-host
at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:71) ~[spring-rabbit-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:509) ~[spring-rabbit-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:700) ~[spring-rabbit-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer.doConsumeFromQueue(DirectMessageListenerContainer.java:663) [spring-rabbit-2.1.6.RELEASE.jar:2.1.6.RELEASE]
... 4 common frames omitted
Caused by: java.net.UnknownHostException: rabbitmq-invalid-host
at java.net.InetAddress.getAllByName0(InetAddress.java:1281) ~[na:1.8.0_212]
at java.net.InetAddress.getAllByName(InetAddress.java:1193) ~[na:1.8.0_212]
at java.net.InetAddress.getAllByName(InetAddress.java:1127) ~[na:1.8.0_212]
at com.rabbitmq.client.DnsRecordIpAddressResolver.resolveIpAddresses(DnsRecordIpAddressResolver.java:83) ~[amqp-client-5.4.3.jar:5.4.3]
at com.rabbitmq.client.DnsRecordIpAddressResolver.getAddresses(DnsRecordIpAddressResolver.java:73) ~[amqp-client-5.4.3.jar:5.4.3]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1098) ~[amqp-client-5.4.3.jar:5.4.3]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1054) ~[amqp-client-5.4.3.jar:5.4.3]
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:994) ~[amqp-client-5.4.3.jar:5.4.3]
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:462) ~[spring-rabbit-2.1.6.RELEASE.jar:2.1.6.RELEASE]
... 6 common frames omitted
2019-06-11 14:56:37.912 INFO 3025 --- [ main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [rabbitmq-invalid-host:5672]
You can listen for the exception in an event listener...
#SpringBootApplication
public class So56270299Application {
public static void main(String[] args) {
SpringApplication.run(So56270299Application.class, args);
}
#EventListener
public void events(ListenerContainerConsumerFailedEvent event) {
System.out.println(event);
if (event.getThrowable().getCause() instanceof UnknownHostException) {
System.exit(1);
}
}
#RabbitListener(queues = "so56270299")
public void listen(String in) {
}
}
and
spring.rabbitmq.host=junk
and
2019-06-11 09:15:09.205 INFO 96620 --- [ntContainer#0-1] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [junk:5672]
2019-06-11 09:15:09.212 INFO 96620 --- [ main] com.example.So56270299Application : Started So56270299Application in 0.704 seconds (JVM running for 1.071)
ListenerContainerConsumerFailedEvent [reason=Consumer raised exception, attempting restart, fatal=false, throwable=org.springframework.amqp.AmqpIOException: java.net.UnknownHostException: junk, container=SimpleMessageListenerContainer [concurrentConsumers=1, queueNames=[so56270299]]]
2019-06-11 09:15:14.255 INFO 96620 --- [ Thread-2] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish.
2019-06-11 09:15:14.255 INFO 96620 --- [ Thread-2] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
2019-06-11 09:15:14.257 INFO 96620 --- [ Thread-2] o.s.a.r.l.SimpleMessageListenerContainer : Shutdown ignored - container is not active already

Resources