Spring Application getting shutdown After Period of time Automatically - spring

I have stated my application then it got shut down after 2 hours automatically and there no logs which tell me the reason. Can anyone help me regarding this? I didn't hit any rest end point but it gets shutdown automatically.
Please find sample logs below.
2018-08-31 17:47:48.099 INFO 18278 --- [main]
c.p.c2i.fulfillment.app.Application : Started Application in
8.936 seconds (JVM running for 9.6)
2018-08-31 20:01:18.904 INFO 18278 --- [Thread-3] ConfigServletWebServerApplicationContext : Closing
org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#5ecddf8f:
startup date [Fri Aug 31 17:47:40 IST 2018]; root of context
hierarchy
2018-08-31 20:01:18.907 INFO 18278 --- [Thread-3] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed
beans on shutdown
2018-08-31 20:01:18.909 INFO 18278 --- [Thread-3] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed
beans
2018-08-31 20:01:18.912 INFO 18278 --- [Thread-3] j.LocalContainerEntityManagerFactoryBean : Closing JPA
EntityManagerFactory for persistence unit 'default'
2018-08-31 20:01:18.913 INFO 18278 --- [Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown
initiated...
2018-08-31 20:01:18.925 INFO 18278 --- [Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown
completed.

Related

Spring boot server all shutdown at the same time for unknown reason

We have a bunch of spring boot servers and they are different code base (but all cloned from the same base)
They all went down last night, at slightly different time. When I looked at the log, it didn't say much. Here is the log
2021-08-06 06:22:09.735 INFO 1 --- [ Thread-4] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'threadPoolTaskScheduler'
2021-08-06 06:22:09.747 INFO 1 --- [ Thread-4] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-08-06 06:22:09.750 INFO 1 --- [ Thread-4] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-08-06 06:22:09.761 INFO 1 --- [ Thread-4] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Here is the log from another project we have
2021-08-06 06:36:39.317 INFO 1 --- [ Thread-3] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler'
2021-08-06 06:36:39.324 INFO 1 --- [ Thread-3] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-08-06 06:36:39.329 INFO 1 --- [ Thread-3] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-08-06 06:36:39.341 INFO 1 --- [ Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-08-06 06:36:39.354 INFO 1 --- [ Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
What could be the reason and how do I troubleshoot this?
The springboot runs inside a docker image, running on ubuntu.
The servers were able to be rebooted immediately without issue.

Integer Next to Log Level in Spring Boot

2021-04-27 00:27:46.292 WARN 74300 --- [ 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
2021-04-27 00:27:46.698 INFO 74300 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-04-27 00:27:47.531 INFO 74300 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2021-04-27 00:27:47.591 INFO 74300 --- [ main] c.s.h.MyApp : Started MyApp in 20.68 seconds (JVM running for 24.132)
What does mean INFO 74300? INFO is log level but what does mean integer next no it? It changes at every running.
That's the PID (Process Identifier)

Hot swap doesn't work with Spring Boot in IntelliJ

(Sorry for my poor English first of all.)
I'm using IntelliJ in two places. (just trial to know about IDE)
I'm doing the same spring boot project via git sharing gradle configuration.
I did setting for hot swap like devtools, registry.. etc) in two PC same.
But one works properly the other is not.
I did test as follow :
run spring boot app
web page works fine.
modify a controller code like adding a message to console.
and embedded tomcat automatically restart.
HERE, one pc works good (print added message perfectly)
but the other doesn't.
after tomcat automatically restart, the same url show Whitelabel Error Page.
I investigated it and found that some logs are different between two pc.
--- logs the one working good :
[ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
[ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
[ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#587affdb, org.springframework.security.web.context.SecurityContextPersistenceFilter#31140227, org.springframework.security.web.header.HeaderWriterFilter#8d6f8a9, org.springframework.web.filter.CharacterEncodingFilter#7b52656a, org.springframework.security.web.authentication.logout.LogoutFilter#79495199, org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter#79292790, org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter#8f41e43, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#3851ad6a, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#2585005f, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#6db344a5, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#1e39862c, org.springframework.security.web.session.SessionManagementFilter#28677efc, org.springframework.security.web.access.ExceptionTranslationFilter#2a7abf09, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#2e8469aa]
[ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
[ restartedMain] aWebConfiguration$JpaWebMvcConfiguration : 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
[ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 80 (http) with context path ''
[ restartedMain] com.community.CommunityApplication : Started CommunityApplication in 8.985 seconds (JVM running for 11.655)
[ Thread-5] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
[ Thread-5] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
[ Thread-5] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'
[ Thread-5] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'inMemoryDatabaseShutdownExecutor': org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-197]
[ Thread-5] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
[ Thread-5] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
__ _ _
_ __ _ \ \ \ \
\/ _` | \ \ \ \
|| (_| | ) ) ) )
|_\__, | / / / /
==|___/=/_/_/_/
(v2.1.2.RELEASE)
[ restartedMain] com.community.CommunityApplication : Starting CommunityApplication on PC with PID 16868 (C:\work\IntelliJ\SpringBootCommunityWeb\out\production\classes started by in C:\work\IntelliJ\SpringBootCommunityWeb)
[ restartedMain] com.community.CommunityApplication : No active profile set, falling back to default profiles: default
[ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
[ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 40ms. Found 2 repository interfaces.
[ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$a49563c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 80 (http)
[ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
[ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.14]
[ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
[ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1177 ms
[ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Starting...
[ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Start completed.
[ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
[ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
[ restartedMain] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl#56c75fda'
[ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
[ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
[ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#34a525ca, org.springframework.security.web.context.SecurityContextPersistenceFilter#1528961c, org.springframework.security.web.header.HeaderWriterFilter#7b2b261c, org.springframework.web.filter.CharacterEncodingFilter#63956f7c, org.springframework.security.web.authentication.logout.LogoutFilter#7246e327, org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter#8fbe389, org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter#e7ddca2, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#738e18a0, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#71f1699c, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#53c8ba78, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#3ed2760, org.springframework.security.web.session.SessionManagementFilter#4c4dac5a, org.springframework.security.web.access.ExceptionTranslationFilter#37fa78f5, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#74967f44]
[ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
[ restartedMain] aWebConfiguration$JpaWebMvcConfiguration : 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
[ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 80 (http) with context path ''
[ restartedMain] com.community.CommunityApplication : Started CommunityApplication in 2.114 seconds (JVM running for 121.368)
[ restartedMain] .ConditionEvaluationDeltaLoggingListener : Condition evaluation unchanged
-- and the other one's logs that doesn't work :
[ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
[ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#8a78527, org.springframework.security.web.context.SecurityContextPersistenceFilter#7bf935e4, org.springframework.security.web.header.HeaderWriterFilter#6d018b44, org.springframework.web.filter.CharacterEncodingFilter#377ccf52, org.springframework.security.web.authentication.logout.LogoutFilter#3dd9bc77, org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter#2ea4eccc, org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter#1de22b60, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#14a9769c, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#8cd9504, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#4add6362, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#2d6a7513, org.springframework.security.web.session.SessionManagementFilter#32857a38, org.springframework.security.web.access.ExceptionTranslationFilter#6c9237d8, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#3e410962]
[ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
[ restartedMain] aWebConfiguration$JpaWebMvcConfiguration : 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
[ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 80 (http) with context path ''
[ restartedMain] com.community.CommunityApplication : Started CommunityApplication in 15.879 seconds (JVM running for 18.138)
**[p-nio-80-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
[p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
[p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 17 ms
[p-nio-80-exec-1] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory**
[ Thread-5] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
[ Thread-5] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
[ Thread-5] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'
[ Thread-5] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'inMemoryDatabaseShutdownExecutor': org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-197]
[ Thread-5] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
[ Thread-5] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
__ _ _
_ __ _ \ \ \ \
\/ _` | \ \ \ \
|| (_| | ) ) ) )
|_\__, | / / / /
==|___/=/_/_/_/
(v2.1.2.RELEASE)
[ restartedMain] com.community.CommunityApplication : Starting CommunityApplication on PC with PID 8468 (C:\workspace\SpringBoot\out\production\classes started by in C:\workspace\SpringBoot)
[ restartedMain] com.community.CommunityApplication : No active profile set, falling back to default profiles: default
[ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
[ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 111ms. Found 2 repository interfaces.
[ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$5ebc4d71] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 80 (http)
[ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
[ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.14]
[ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
[ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2766 ms
[ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Starting...
[ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Start completed.
[ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
[ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
[ restartedMain] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl#2812f6b8'
[ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
[ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
[ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#267bc281, org.springframework.security.web.context.SecurityContextPersistenceFilter#2afc1d8, org.springframework.security.web.header.HeaderWriterFilter#5962cf57, org.springframework.web.filter.CharacterEncodingFilter#7790e093, org.springframework.security.web.authentication.logout.LogoutFilter#77bf42d5, org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter#319c14c1, org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter#37184e4e, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#5cff9178, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#97e2d0c, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#46a95303, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#28faa11, org.springframework.security.web.session.SessionManagementFilter#796d63d, org.springframework.security.web.access.ExceptionTranslationFilter#732f1ea7, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#1fccb650]
[ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
[ restartedMain] aWebConfiguration$JpaWebMvcConfiguration : 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
[ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 80 (http) with context path ''
[ restartedMain] com.community.CommunityApplication : Started CommunityApplication in 4.412 seconds (JVM running for 80.618)
[ restartedMain] .ConditionEvaluationDeltaLoggingListener : Condition evaluation unchanged
[p-nio-80-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
[p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
[p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 19 ms
Only different part is below and hot swap doesn't work if this shows in logs.
This could be a stupid question but I'm really wonder.
Do you have any suggestion for me?
**[p-nio-80-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
[p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
[p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 17 ms
[p-nio-80-exec-1] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory**

Spring Boot Run failed

I am using Spring to build my application.
I used Spring Initializr to build my project.
I included the following dependencies:-
JPA
h2 (database)
ThymeLeaf templating engine
Spring Actuator
DevTools
Security
I am using IntelliJ IDEA IDE using Gradle build on Windows Machine.
NOTE:- I have not changed gradle(v4.8) build file.
Down below is the result of running SpringBootApplication:-
"C:\Program Files\Java\jdk1.8.0_171\bin\java.exe" -javaagent:C:\Users\ayman\Downloads\Software\IntelliJIdea\lib\idea_rt.jar=61199:C:\Users\E080978\Downloads\Software\IntelliJIdea\bin -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_171\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_171\jre\lib\rt.jar;C:\Users\E080978\Downloads\Mastercard Image\demo\out\production\classes;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-actuator\2.0.3.RELEASE\d370eeff676d24523ee530f6abc569474d2f9bf9\spring-boot-starter-actuator-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\2.0.3.RELEASE\56c909f49b5385793942158e143187ecc8c7b54a\spring-boot-starter-data-jpa-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-security\2.0.3.RELEASE\67de3ced1ebc68c7bbd9bc2ced390821fa682c2f\spring-boot-starter-security-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-thymeleaf\2.0.3.RELEASE\7a8cf11f5b7faa244e1979df491811bc0c858743\spring-boot-starter-thymeleaf-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-aop\2.0.3.RELEASE\a78c7bc25fd51b217f078421dc40d13ddc3b9f8f\spring-boot-starter-aop-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\2.0.3.RELEASE\4f5f3411692a0f5efb60f7f583bdfcf49199a3d4\spring-boot-starter-jdbc-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\2.0.3.RELEASE\ffaa050dbd36b0441645598f1a7ddaf67fd5e678\spring-boot-starter-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-devtools\2.0.3.RELEASE\478e12e423b45d182a409f12a28fb9f0cddf84bf\spring-boot-devtools-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-actuator-autoconfigure\2.0.3.RELEASE\f3e3392c3e8e2714fc05bbf0f3ee496ad19eedc7\spring-boot-actuator-autoconfigure-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\com.h2database\h2\1.4.197\bb391050048ca8ae3e32451b5a3714ecd3596a46\h2-1.4.197.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-core\1.0.5\c5eaa23f5bb1f0f4b7eb44824093874d0d9165f5\micrometer-core-1.0.5.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.hibernate\hibernate-core\5.2.17.Final\f2dc36470e7a2ffcf6106bb1625ecf5b54bb5f65\hibernate-core-5.2.17.Final.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\javax.transaction\javax.transaction-api\1.2\d81aff979d603edd90dcd8db2abc1f4ce6479e3e\javax.transaction-api-1.2.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\2.0.8.RELEASE\8b874afd15da2b4d2d9b8431ad2be0c6829e41fe\spring-data-jpa-2.0.8.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\5.0.7.RELEASE\afd3f7ecb9d7c2cb3160563f9f64b72223bb0265\spring-aspects-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-config\5.0.6.RELEASE\60367d94d253c82781b7f9abf2294cd0295e1c1\spring-security-config-5.0.6.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-web\5.0.6.RELEASE\f502d929ee62f5dce0fc942f5a22faa52eaaac34\spring-security-web-5.0.6.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\2.0.3.RELEASE\11bc4cc96b08fabad2b3186755818fa0b32d83f\spring-boot-autoconfigure-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-actuator\2.0.3.RELEASE\5aa239d8ad6d8130b055caebf44467b9c55d422b\spring-boot-actuator-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\2.0.3.RELEASE\b874870d915adbc3dd932e19077d3d45c8e54aa0\spring-boot-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-core\5.0.6.RELEASE\11c0291cc9cda839b7feb52c519f4a35dc6e251b\spring-security-core-5.0.6.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\5.0.7.RELEASE\243a23f8968de8754d8199d669780d683ab177bd\spring-context-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\5.0.7.RELEASE\fdd0b6aa3c9c7a188c3bfbf6dfd8d40e843be9ef\spring-aop-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf-spring5\3.0.9.RELEASE\abf84efd83808a70d982d2790f7f3a7bd3a39cf4\thymeleaf-spring5-3.0.9.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.thymeleaf.extras\thymeleaf-extras-java8time\3.0.1.RELEASE\d23760d1e53cd70c489ef40dc94ee6bd2371cceb\thymeleaf-extras-java8time-3.0.1.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\2.0.3.RELEASE\7caad34f01d2688919e15e09a90467963e3d5190\spring-boot-starter-logging-2.0.3.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\javax.annotation\javax.annotation-api\1.3.2\934c04d3cfef185a8008e7bf34331b79730a9d43\javax.annotation-api-1.3.2.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\5.0.7.RELEASE\4deed5f4a38d62f9dba7db8e010da8b49e322757\spring-orm-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\5.0.7.RELEASE\9c78c6b9a6c603f6589b480e165939cde7bab7f9\spring-jdbc-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\2.0.8.RELEASE\5c19af63b5acb0eab39066684e813d5ecd9d03b7\spring-data-commons-2.0.8.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\5.0.7.RELEASE\4ca59b21c61162adb146ad1b40c30b60d8dc42b8\spring-tx-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\5.0.7.RELEASE\2e04c6c2922fbfa06b5948be14a5782db168b6ec\spring-web-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\5.0.7.RELEASE\c1196cb3e56da83e3c3a02ef323699f4b05feedc\spring-beans-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\5.0.7.RELEASE\ca01fb473f53dd0ee3c85663b26d5dc325602057\spring-expression-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\5.0.7.RELEASE\54b731178d81e66eca9623df772ff32718208137\spring-core-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.19\2d998d3d674b172a588e54ab619854d073f555b5\snakeyaml-1.19.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.9.6\ea54f6193d224e5e5732bbd4262327eb465397c2\jackson-datatype-jsr310-2.9.6.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.9.6\cfa4f316351a91bfd95cb0644c6a2c95f52db1fc\jackson-databind-2.9.6.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.hdrhistogram\HdrHistogram\2.1.10\9e1ac84eed220281841b75e72fb9de5a297fbf04\HdrHistogram-2.1.10.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.latencyutils\LatencyUtils\2.0.3\769c0b82cb2421c8256300e907298a9410a2a3d3\LatencyUtils-2.0.3.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.8.13\ad94df2a28d658a40dc27bbaff6a1ce5fbf04e9b\aspectjweaver-1.8.13.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\2.7.9\a83113d2c091d0d0f853dad3217bd7df3beb6ae3\HikariCP-2.7.9.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\5.0.1.Final\71e1cff3fcb20d3b3af4f3363c3ddb24d33c6879\hibernate-commons-annotations-5.0.1.Final.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.3.2.Final\3789d00e859632e6c6206adc0c71625559e6e3b0\jboss-logging-3.3.2.Final.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.hibernate.javax.persistence\hibernate-jpa-2.1-api\1.0.2.Final\52afb5762c704a6b586e27742470c08f91877fc1\hibernate-jpa-2.1-api-1.0.2.Final.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.javassist\javassist\3.22.0-GA\3e83394258ae2089be7219b971ec21a8288528ad\javassist-3.22.0-GA.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\antlr\antlr\2.7.7\83cd2cd674a217ade95a4bb83a8a14f351f48bd0\antlr-2.7.7.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.jboss\jandex\2.0.3.Final\bfc4d6257dbff7a33a357f0de116be6ff951d849\jandex-2.0.3.Final.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.3.4\3d5f48f10bbe4eb7bd862f10c0583be2e0053c6\classmate-1.3.4.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\dom4j\dom4j\1.6.1\5d3ccc056b6f056dbf0dddfdf43894b9065a8f94\dom4j-1.6.1.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.thymeleaf\thymeleaf\3.0.9.RELEASE\64185cca50ac808ad034841c84b4013f955465d2\thymeleaf-3.0.9.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.2.3\7c4f3c474fb2c041d8028740440937705ebb473a\logback-classic-1.2.3.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.10.0\f7e631ccf49cfc0aefa4a2a728da7d374c05bd3c\log4j-to-slf4j-2.10.0.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\1.7.25\af5364cd6679bfffb114f0dec8a157aaa283b76\jul-to-slf4j-1.7.25.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\1.7.25\da76ca59f6a57ee3102f8f9bd9cee742973efa8a\slf4j-api-1.7.25.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\5.0.7.RELEASE\699016ddf454c2c167d9f84ae5777eccadf54728\spring-jcl-5.0.7.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.9.0\7c10d545325e3a6e72e06381afe469fd40eb701\jackson-annotations-2.9.0.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.9.6\4e393793c37c77e042ccc7be5a914ae39251b365\jackson-core-2.9.6.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.attoparser\attoparser\2.0.4.RELEASE\5cf02c4d8303a81f0c80971bb1dcd40d3ba96009\attoparser-2.0.4.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.unbescape\unbescape\1.1.5.RELEASE\46dc644ea9c234317d926ebac5bf5d8f114dc1ba\unbescape-1.1.5.RELEASE.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.2.3\864344400c3d4d92dfeb0a305dc87d953677c03c\logback-core-1.2.3.jar;C:\Users\E080978\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.10.0\fec5797a55b786184a537abd39c3fa1449d752d6\log4j-api-2.10.0.jar" com.mastercard.ayman.imagepackt.ImagePacktApplication
12:37:05.891 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
12:37:05.898 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/, /spring-boot/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter/target/classes/]
12:37:05.898 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/C:/Users/E080978/Downloads/Mastercard%20Image/demo/out/production/classes/]
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.3.RELEASE)
2018-06-20 12:37:06.301 INFO 23152 --- [ restartedMain] c.m.a.imagepackt.ImagePacktApplication : Starting ImagePacktApplication on GH-6C9HNH2 with PID 23152 (started by E080978 in C:\Users\E080978\Downloads\Mastercard Image\demo)
2018-06-20 12:37:06.302 INFO 23152 --- [ restartedMain] c.m.a.imagepackt.ImagePacktApplication : No active profile set, falling back to default profiles: default
2018-06-20 12:37:06.374 INFO 23152 --- [ restartedMain] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#17c49070: startup date [Wed Jun 20 12:37:06 IST 2018]; root of context hierarchy
2018-06-20 12:37:07.824 INFO 23152 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$b97b663c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-06-20 12:37:08.184 INFO 23152 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2018-06-20 12:37:08.349 INFO 23152 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2018-06-20 12:37:08.409 INFO 23152 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2018-06-20 12:37:08.431 INFO 23152 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2018-06-20 12:37:08.523 INFO 23152 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate Core {5.2.17.Final}
2018-06-20 12:37:08.524 INFO 23152 --- [ restartedMain] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2018-06-20 12:37:08.566 INFO 23152 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-06-20 12:37:08.713 INFO 23152 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2018-06-20 12:37:09.315 INFO 23152 --- [ restartedMain] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl#2c5eb52e'
2018-06-20 12:37:09.319 INFO 23152 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2018-06-20 12:37:10.108 WARN 23152 --- [ restartedMain] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration)
2018-06-20 12:37:10.246 INFO 23152 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-06-20 12:37:10.284 INFO 23152 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-06-20 12:37:10.285 INFO 23152 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure
2018-06-20 12:37:10.289 INFO 23152 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]
2018-06-20 12:37:10.302 INFO 23152 --- [ restartedMain] c.m.a.imagepackt.ImagePacktApplication : Started ImagePacktApplication in 4.384 seconds (JVM running for 5.279)
2018-06-20 12:37:10.308 INFO 23152 --- [ Thread-10] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext#17c49070: startup date [Wed Jun 20 12:37:06 IST 2018]; root of context hierarchy
2018-06-20 12:37:10.312 INFO 23152 --- [ Thread-10] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2018-06-20 12:37:10.313 INFO 23152 --- [ Thread-10] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans
2018-06-20 12:37:10.314 INFO 23152 --- [ Thread-10] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2018-06-20 12:37:10.315 INFO 23152 --- [ Thread-10] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed drop of schema as part of SessionFactory shut-down'
2018-06-20 12:37:10.320 WARN 23152 --- [ Thread-10] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'inMemoryDatabaseShutdownExecutor': org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-197]
2018-06-20 12:37:10.321 INFO 23152 --- [ Thread-10] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2018-06-20 12:37:10.323 INFO 23152 --- [ Thread-10] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Process finished with exit code 0
According to me these two lines are the problem:
1.The first line
Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$b97b663c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-06-20 12:37:08.184 INFO 23152 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource :
2.The second line
2018-06-20 12:37:10.320 WARN 23152 --- [ Thread-10] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'inMemoryDatabaseShutdownExecutor': org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-197]
I have not done any configuration on the database. Do I need to change database properties for the same?
This is expected. Your app doesn't have any web dependencies, it's simply starting up, running and closing.
Add
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
If you want an embedded container to run.
I should add you will not see this with < 2.0 and those starters, since boot 2.0 and WebFlux Spring boot starter web is no longer a transitive dependency. You must specify it.
... add ";DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE" to the db URL ...
Add to application.properties file:
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
probably you need to exclude datasource(if you already have your own datasource configured for application) auto configuration in main class.
#SpringBootApplication(exclude = { DataSourceAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class})

Error registering service to eureka server

I am trying to register a client to spring-eureka-server, client deregisters just after registering
eureka-server logs:
2018-05-13 16:02:47.290 INFO 25557 --- [io-9091-exec-10]
c.n.e.registry.AbstractInstanceRegistry : Registered instance
HELLO-CLIENT/192.168.43.96:hello-client:8072 with status UP
(replication=false) 2018-05-13 16:02:47.438 INFO 25557 ---
[nio-9091-exec-3] c.n.e.registry.AbstractInstanceRegistry :
Registered instance HELLO-CLIENT/192.168.43.96:hello-client:8072 with
status DOWN (replication=false) 2018-05-13 16:02:47.457 INFO 25557
--- [nio-9091-exec-2] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance HELLO-CLIENT/192.168.43.96:hello-client:8072
(replication=false) 2018-05-13 16:02:47.950 INFO 25557 ---
[nio-9091-exec-5] c.n.e.registry.AbstractInstanceRegistry :
Registered instance HELLO-CLIENT/192.168.43.96:hello-client:8072 with
status DOWN (replication=true) 2018-05-13 16:02:47.951 INFO 25557 ---
[nio-9091-exec-5] c.n.e.registry.AbstractInstanceRegistry : Cancelled
instance HELLO-CLIENT/192.168.43.96:hello-client:8072
(replication=true) 2018-05-13 16:03:25.747 INFO 25557 ---
[a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running
the evict task with compensationTime 4ms
Eureka-client logs:
2018-05-13 16:02:47.163 INFO 25676 --- [nfoReplicator-0]
com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072:
registering service... 2018-05-13 16:02:47.212 INFO 25676 --- [
main] c.a.helloclient.HelloClientApplication : Started
HelloClientApplication in 7.62 seconds (JVM running for 8.573)
2018-05-13 16:02:47.224 INFO 25676 --- [ Thread-5]
s.c.a.AnnotationConfigApplicationContext : Closing
org.springframework.context.annotation.AnnotationConfigApplicationContext#6f7923a5:
startup date [Sun May 13 16:02:42 IST 2018]; parent:
org.springframework.context.annotation.AnnotationConfigApplicationContext#5c30a9b0
2018-05-13 16:02:47.226 INFO 25676 --- [ Thread-5]
o.s.c.n.e.s.EurekaServiceRegistry : Unregistering application
hello-client with eureka with status DOWN 2018-05-13 16:02:47.227
WARN 25676 --- [ Thread-5] com.netflix.discovery.DiscoveryClient
: Saw local status change event StatusChangeEvent
[timestamp=1526207567227, current=DOWN, previous=UP] 2018-05-13
16:02:47.232 INFO 25676 --- [ Thread-5]
o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2018-05-13 16:02:47.235 INFO 25676 --- [ Thread-5]
com.netflix.discovery.DiscoveryClient : Shutting down
DiscoveryClient ... 2018-05-13 16:02:47.292 INFO 25676 ---
[nfoReplicator-0] com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072 -
registration status: 204 2018-05-13 16:02:47.423 INFO 25676 ---
[nfoReplicator-0] com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072:
registering service... 2018-05-13 16:02:47.440 INFO 25676 ---
[nfoReplicator-0] com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072 -
registration status: 204 2018-05-13 16:02:47.442 INFO 25676 --- [
Thread-5] com.netflix.discovery.DiscoveryClient : Unregistering ...
2018-05-13 16:02:47.460 INFO 25676 --- [ Thread-5]
com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072 -
deregister status: 200 2018-05-13 16:02:47.494 INFO 25676 --- [
Thread-5] com.netflix.discovery.DiscoveryClient : Completed shut
down of DiscoveryClient 2018-05-13 16:02:47.495 INFO 25676 --- [
Thread-5] o.s.j.e.a.AnnotationMBeanExporter : Unregistering
JMX-exposed beans on shutdown 2018-05-13 16:02:47.498 INFO 25676 ---
[ Thread-5] o.s.j.e.a.AnnotationMBeanExporter :
Unregistering JMX-exposed beans
Please let me know what could be possibly wrong.
Add
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
into Eureka and client app
It really works !!!
Eureka client deregisters when an app has been shutdown.
Check if there is any other reason why the app is stopping leading to eureka-client deregistering.
For my case, the application was shutting down due to spring-boot-starter-web dependency. After resolving this, the application started well.
Looks like a dependency issue.
If the app works fine (the core functionality) without eureka integration, then try changing the eureka-client dependency version.
I would suggest you to check the following:
Check all the port numbers that you are running
Check for any version issues
Add above web dependency in your eureka pom.xml (it worked for me in Maven projects)

Resources