H2 is missing so the following "APPLICATION FAILED TO START" message has been printed but the application was still running:
$ ./gradlew clean bootRun
> Task :compileJava
Note: /Users/izeye/IdeaProjects/sample-micrometer-spring-boot/src/main/java/com/izeye/sample/web/SampleController.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :bootRun
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.0.M3)
2019-05-20 10:56:19.939 INFO 6231 --- [ main] com.izeye.sample.Application : Starting Application on AL01404673.local with PID 6231 (/Users/izeye/IdeaProjects/sample-micrometer-spring-boot/build/classes/java/main started by user in /Users/izeye/IdeaProjects/sample-micrometer-spring-boot)
2019-05-20 10:56:19.942 INFO 6231 --- [ main] com.izeye.sample.Application : No active profile set, falling back to default profiles: default
2019-05-20 10:56:20.711 INFO 6231 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$42357030] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-05-20 10:56:20.968 INFO 6231 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-05-20 10:56:20.998 INFO 6231 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-05-20 10:56:20.998 INFO 6231 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.19]
2019-05-20 10:56:21.094 INFO 6231 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-05-20 10:56:21.094 INFO 6231 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1114 ms
2019-05-20 10:56:21.254 ERROR 6231 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicatorRegistry]: Factory method 'healthIndicatorRegistry' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2019-05-20 10:56:21.276 INFO 6231 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-05-20 10:56:21.280 WARN 6231 --- [ 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
2019-05-20 10:56:21.291 INFO 6231 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-05-20 10:56:21.293 ERROR 6231 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
<==========---> 80% EXECUTING [1m 14s]
> :bootRun
This is the sample project I used: https://github.com/izeye/sample-micrometer-spring-boot/tree/spring-boot-gh-16902
Hi!
Just letting you know that I tested the sample provided and was able to reproduce it reliably.
The problem appears to be the same reported and fixed in #16892, because after the main thread dies, there are two non-daemon threads running, called Catalina-utility-1 and Catalina-utility-2.
After #16892 get's merged, this issue should be reviewed to check if it fixed.
Thanks for the sample, @izeye. As @jpmsilva suspected (thank you), this is the same problem as #16892 and it does not occur with the latest 2.1.6 snapshots where bootRun now fails:
./gradlew bootRun
> Task :bootRun FAILED
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.6.BUILD-SNAPSHOT)
2019-05-29 11:31:31.219 INFO 94293 --- [ main] com.izeye.sample.Application : Starting Application on Andys-MacBook-Pro.local with PID 94293 (/Users/awilkinson/dev/temp/sample-micrometer-spring-boot/build/classes/java/main started by awilkinson in /Users/awilkinson/dev/temp/sample-micrometer-spring-boot)
2019-05-29 11:31:31.221 INFO 94293 --- [ main] com.izeye.sample.Application : No active profile set, falling back to default profiles: default
2019-05-29 11:31:32.023 INFO 94293 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$d1aae699] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-05-29 11:31:32.233 INFO 94293 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-05-29 11:31:32.255 INFO 94293 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-05-29 11:31:32.255 INFO 94293 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.20]
2019-05-29 11:31:32.342 INFO 94293 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-05-29 11:31:32.342 INFO 94293 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1087 ms
2019-05-29 11:31:32.492 ERROR 94293 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicatorRegistry]: Factory method 'healthIndicatorRegistry' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2019-05-29 11:31:32.508 INFO 94293 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-05-29 11:31:32.512 WARN 94293 --- [ 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
2019-05-29 11:31:32.520 INFO 94293 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-05-29 11:31:32.521 ERROR 94293 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command '/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
3 actionable tasks: 1 executed, 2 up-to-date
The latest 2.2.0 snapshots behave similarly.
Duplicate of #16892
Most helpful comment
Hi!
Just letting you know that I tested the sample provided and was able to reproduce it reliably.
The problem appears to be the same reported and fixed in #16892, because after the main thread dies, there are two non-daemon threads running, called
Catalina-utility-1andCatalina-utility-2.After #16892 get's merged, this issue should be reviewed to check if it fixed.