Spring Boot 2.1.x ã® Web ã¢ããªã 2.2.x ã¸ãã¼ã¸ã§ã³ã¢ãããã ( ãã®ï¼ï¼ )( spring.main.lazy-initialization ã試ãã¦ã¿ã )
æ¦è¦
è¨äºä¸è¦§ã¯ãã¡ãã§ãã
Spring Boot 2.1.x ã® Web ã¢ããªã 2.2.x ã¸ãã¼ã¸ã§ã³ã¢ãããã ( ãã®ï¼ï¼ )( Docker ã³ã³ããã® image ããã¼ã¸ã§ã³ã¢ãããã ) ã®ç¶ãã§ãã
- ä»åã®æé ã§ç¢ºèªã§ããã®ã¯ä»¥ä¸ã®å
容ã§ãã
- Bean ã®çæã¿ã¤ãã³ã°ãèµ·åæã§ã¯ãªãå¿ è¦ã«ãªã£ãã¿ã¤ãã³ã°ã«ãããã¨ã§èµ·åæéãç縮ããããã® spring.main.lazy-initialization ã¨ããè¨å®é ç®ã追å ãããã®ã§ãã©ã®ãããç縮ã§ããã®ã試ãã¦ã¿ã¾ãã
åç §ãããµã¤ãã»æ¸ç±
-
Spring - Multiple Spring Data modules found, entering strict repository configuration mode
https://stackoverflow.com/questions/47002094/spring-multiple-spring-data-modules-found-entering-strict-repository-configur 4.3.2. Using Repositories with Multiple Spring Data Modules
https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.multiple-modulesspring-projects/spring-data-redis - Redis Repositories
https://github.com/spring-projects/spring-data-redis/blob/master/src/main/asciidoc/reference/redis-repositories.adocSpring Session - Spring Boot
https://docs.spring.io/spring-session/docs/current/reference/html5/guides/boot-redis.htmlLazy Initialization in Spring Boot 2.2
https://spring.io/blog/2019/03/14/lazy-initialization-in-spring-boot-2-2
ç®æ¬¡
- jar ãã¡ã¤ã«ãä½æãã¦èµ·åæéãç縮ããããã®ãªãã·ã§ã³ãªãã§å®è¡ãã¦ã¿ã
-Dspring.main.lazy-initialization=true
ã追å ãã¦ã¿ã-XX:TieredStopAtLevel=1
ã追å ãã¦ã¿ãMultiple Spring Data modules found, entering strict repository configuration mode!
ã¨ã¯ï¼s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
ã®ãã°ããªãåºåãããã®ãï¼-Dspring.main.lazy-initialization=true
ãè¨å®ããã¨/actuator/health
ãä½ãè¿ããªããªãï¼ï¼- æå¾ã«
æé
jar ãã¡ã¤ã«ãä½æãã¦èµ·åæéãç縮ããããã®ãªãã·ã§ã³ãªãã§å®è¡ãã¦ã¿ã
ã¾ã㯠ksbysample-webapp-lending-2.2.2-RELEASE.jar ãä½æãã¦ãèµ·åæéãç縮ããããã®ãªãã·ã§ã³ã¯ä½ãã¤ããªã以ä¸ã®ã³ãã³ãã§èµ·åãã¦ã¿ã¾ãã
set JAVA_HOME=D:\Java\jdk-11.0.5+10 set PATH=%JAVA_HOME%\bin;%PATH% set WEBAPP_HOME=D:\webapps\ksbysample-webapp-lending set WEBAPP_JAR=ksbysample-webapp-lending-2.2.2-RELEASE.jar set LOGS_DIR=%WEBAPP_HOME%\logs set PATH_HEAPDUMPFILE=%LOGS_DIR%\heapdump.hprof set PATH_ERRORFILE=%LOGS_DIR%\hs_err.log java -Xms1024m -Xmx1024m ^ -XX:MaxMetaspaceSize=384m ^ -XX:+UseG1GC ^ -Xlog:gc*=debug:logs/gc.log:time,level,tags:filesize=10m,filecount=5 ^ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%PATH_HEAPDUMPFILE% ^ -XX:+CrashOnOutOfMemoryError ^ -XX:ErrorFile=%PATH_ERRORFILE% ^ -Dsun.net.inetaddr.ttl=100 ^ -Dspring.profiles.active=product ^ -jar lib\%WEBAPP_JAR%
ï¼åå®è¡ã㦠Started Application in ... seconds
ã«è¡¨ç¤ºãããæé㯠14.955ã15.53ã16.493ã15.992ã15.773ï¼å¹³å 15.7486ï¼ã§ããã
14.955 ã®æã® Starting Application on ...
ï½ Started Application in ... seconds
ã¾ã§ã®ãã°ã¯ä»¥ä¸ã®ãã®ã§ããã
2020-01-08 00:29:58.925 INFO 9200 --- [main] ksbysample.webapp.lending.Application : Starting Application on PC-02 with PID 9200 (D:\webapps\ksbysample-webapp-lending\lib\ksbysample-webapp-lending-2.2.2-RELEASE.jar started by root in D:\webapps\ksbysample-webapp-lending) 2020-01-08 00:29:58.929 INFO 9200 --- [main] ksbysample.webapp.lending.Application : The following profiles are active: product 2020-01-08 00:30:01.018 INFO 9200 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode! 2020-01-08 00:30:01.021 INFO 9200 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode. 2020-01-08 00:30:01.084 INFO 9200 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 41ms. Found 0 Redis repository interfaces. 2020-01-08 00:30:01.938 INFO 9200 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' of type [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 00:30:02.010 INFO 9200 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 00:30:02.593 INFO 9200 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 00:30:02.602 INFO 9200 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 00:30:02.611 INFO 9200 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@6d1310f6' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 00:30:02.615 INFO 9200 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 00:30:02.641 INFO 9200 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 00:30:03.758 INFO 9200 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2020-01-08 00:30:03.783 INFO 9200 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-01-08 00:30:03.783 INFO 9200 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.29] 2020-01-08 00:30:03.884 INFO 9200 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-01-08 00:30:03.884 INFO 9200 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 4848 ms 2020-01-08 00:30:04.743 INFO 9200 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 2020-01-08 00:30:07.902 INFO 9200 --- [main] io.lettuce.core.EpollProvider : Starting without optional epoll library 2020-01-08 00:30:07.905 INFO 9200 --- [main] io.lettuce.core.KqueueProvider : Starting without optional kqueue library 2020-01-08 00:30:09.538 INFO 9200 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2020-01-08 00:30:10.537 INFO 9200 --- [main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 6.1.3 by Redgate 2020-01-08 00:30:10.549 INFO 9200 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2020-01-08 00:30:10.759 INFO 9200 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2020-01-08 00:30:10.804 INFO 9200 --- [main] o.f.c.internal.database.DatabaseFactory : Database: jdbc:postgresql://localhost/ksbylending (PostgreSQL 12.1) 2020-01-08 00:30:10.864 INFO 9200 --- [main] o.f.core.internal.command.DbValidate : Successfully validated 2 migrations (execution time 00:00.033s) 2020-01-08 00:30:10.885 INFO 9200 --- [main] o.f.core.internal.command.DbMigrate : Current version of schema "public": 1.1 2020-01-08 00:30:10.887 INFO 9200 --- [main] o.f.core.internal.command.DbMigrate : Schema "public" is up to date. No migration necessary. 2020-01-08 00:30:11.364 INFO 9200 --- [main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest$EndpointRequestMatcher@2484dbb7, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@111cba40, org.springframework.security.web.context.SecurityContextPersistenceFilter@696fad31, org.springframework.security.web.header.HeaderWriterFilter@4652c74d, org.springframework.security.web.csrf.CsrfFilter@238291d4, org.springframework.security.web.authentication.logout.LogoutFilter@6ad6443, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@55296b50, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@3c18942, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@2c48cede, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@48e41b5d, org.springframework.security.web.session.SessionManagementFilter@5ea7bc4, org.springframework.security.web.access.ExceptionTranslationFilter@c48b543, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@77083e41] 2020-01-08 00:30:11.419 INFO 9200 --- [main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@5c448ef, org.springframework.security.web.context.SecurityContextPersistenceFilter@4a31ed12, org.springframework.security.web.header.HeaderWriterFilter@11810917, org.springframework.security.web.csrf.CsrfFilter@75bd28d, org.springframework.security.web.authentication.logout.LogoutFilter@49232c6f, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@5fb54740, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@3ab595c8, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@2365ea38, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@1ee40b5c, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@703e8050, org.springframework.security.web.session.SessionManagementFilter@13278a41, org.springframework.security.web.access.ExceptionTranslationFilter@129c4d19, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@5e3db14] 2020-01-08 00:30:11.676 INFO 9200 --- [main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 4 endpoint(s) beneath base path '/actuator' 2020-01-08 00:30:12.364 INFO 9200 --- [main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672] 2020-01-08 00:30:12.464 INFO 9200 --- [main] o.s.a.r.c.CachingConnectionFactory : Created new connection: rabbitConnectionFactory#70f31322:0/SimpleConnection@33d230ce [delegate=amqp://[email protected]:5672/, localPort= 56784] 2020-01-08 00:30:12.469 INFO 9200 --- [main] o.s.amqp.rabbit.core.RabbitAdmin : Auto-declaring a non-durable, auto-delete, or exclusive Queue (InquiringStatusOfBookQueue) durable:false, auto-delete:false, exclusive:false. It will be redeclared if the broker stops and is restarted while the connection factory is alive, but all messages will be lost. 2020-01-08 00:30:12.557 INFO 9200 --- [main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing 2020-01-08 00:30:12.605 INFO 9200 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2020-01-08 00:30:12.610 INFO 9200 --- [main] ksbysample.webapp.lending.Application : Started Application in 14.955 seconds (JVM running for 15.936)
æéãããã£ã¦ããã¨æãããç®æãåãåºãã¦ã¿ã¾ããã
2020-01-08 00:30:01.018 INFO 9200 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
ï¼ç´2ç§ï¼2020-01-08 00:30:03.758 INFO 9200 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
ï¼ç´1ç§ï¼2020-01-08 00:30:04.743 INFO 9200 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService
ï¼ç´1ç§ï¼2020-01-08 00:30:07.902 INFO 9200 --- [main] io.lettuce.core.EpollProvider : Starting without optional epoll library
ï¼ç´3ç§ï¼2020-01-08 00:30:09.538 INFO 9200 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
ï¼ç´1.5ç§ï¼2020-01-08 00:30:10.537 INFO 9200 --- [main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 6.1.3 by Redgate
ï¼ç´1ç§ï¼2020-01-08 00:30:12.364 INFO 9200 --- [main] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: [localhost:5672]
ï¼ç´0.7ç§ï¼
-Dspring.main.lazy-initialization=true
ã追å ãã¦ã¿ã
ä»åº¦ã¯ -Dspring.main.lazy-initialization=true
ã追å ãã以ä¸ã®ã³ãã³ãã§èµ·åãã¦ã¿ã¾ãã
java -Xms1024m -Xmx1024m ^ -XX:MaxMetaspaceSize=384m ^ -XX:+UseG1GC ^ -Xlog:gc*=debug:logs/gc.log:time,level,tags:filesize=10m,filecount=5 ^ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%PATH_HEAPDUMPFILE% ^ -XX:+CrashOnOutOfMemoryError ^ -XX:ErrorFile=%PATH_ERRORFILE% ^ -Dsun.net.inetaddr.ttl=100 ^ -Dspring.profiles.active=product ^ -Dspring.main.lazy-initialization=true ^ -jar lib\%WEBAPP_JAR%
ï¼åå®è¡ã㦠Started Application in ... seconds
ã«è¡¨ç¤ºãããæé㯠11.479ã12.201ã12.216ã11.865ã11.346ï¼å¹³å 11.8214ãâ¼3.9272ï¼ã§ããã
2020-01-08 23:24:29.483 INFO 20304 --- [main] ksbysample.webapp.lending.Application : Starting Application on PC-02 with PID 20304 (D:\webapps\ksbysample-webapp-lending\lib\ksbysample-webapp-lending-2.2.2-RELEASE.jar started by root in D:\webapps\ksbysample-webapp-lending) 2020-01-08 23:24:29.486 INFO 20304 --- [main] ksbysample.webapp.lending.Application : The following profiles are active: product 2020-01-08 23:24:31.506 INFO 20304 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode! 2020-01-08 23:24:31.510 INFO 20304 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode. 2020-01-08 23:24:31.578 INFO 20304 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 43ms. Found 0 Redis repository interfaces. 2020-01-08 23:24:32.455 INFO 20304 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' of type [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:24:32.529 INFO 20304 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:24:33.135 INFO 20304 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:24:33.150 INFO 20304 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:24:33.163 INFO 20304 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@3228d990' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:24:33.168 INFO 20304 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:24:33.191 INFO 20304 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:24:34.314 INFO 20304 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2020-01-08 23:24:34.361 INFO 20304 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-01-08 23:24:34.362 INFO 20304 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.29] 2020-01-08 23:24:34.549 INFO 20304 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-01-08 23:24:34.550 INFO 20304 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 4954 ms 2020-01-08 23:24:35.506 INFO 20304 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 2020-01-08 23:24:37.141 INFO 20304 --- [springSessionRedisMessageListenerContainer-1] io.lettuce.core.EpollProvider : Starting without optional epoll library 2020-01-08 23:24:37.143 INFO 20304 --- [springSessionRedisMessageListenerContainer-1] io.lettuce.core.KqueueProvider : Starting without optional kqueue library 2020-01-08 23:24:39.653 INFO 20304 --- [main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing 2020-01-08 23:24:39.715 INFO 20304 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2020-01-08 23:24:39.724 INFO 20304 --- [main] ksbysample.webapp.lending.Application : Started Application in 11.479 seconds (JVM running for 12.281)
æéãããã£ã¦ããã¨æãããç®æãåãåºãã¦ã¿ã¾ãããâ ã¯ï¼åç®ã¨æ¯è¼ãã¦å度åºã¦ãããã°ã«ä»ãã¦ãã¾ãã
2020-01-08 23:24:31.506 INFO 20304 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
ï¼ç´2ç§â â ï¼2020-01-08 23:24:32.455 INFO 20304 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' of type [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
ï¼ç´1ç§ï¼2020-01-08 23:24:34.314 INFO 20304 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
ï¼ç´1ç§â â ï¼2020-01-08 23:24:35.506 INFO 20304 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService
ï¼ç´1ç§â â ï¼2020-01-08 23:24:37.141 INFO 20304 --- [springSessionRedisMessageListenerContainer-1] io.lettuce.core.EpollProvider : Starting without optional epoll library
ï¼ç´1.5ç§â â ï¼2020-01-08 23:24:39.653 INFO 20304 --- [main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
ï¼ç´2.5ç§ï¼
-XX:TieredStopAtLevel=1
ã追å ãã¦ã¿ã
æ´ã« -XX:TieredStopAtLevel=1
ã追å ãã以ä¸ã®ã³ãã³ãã§èµ·åãã¦ã¿ã¾ãã
java -Xms1024m -Xmx1024m ^ -XX:MaxMetaspaceSize=384m ^ -XX:+UseG1GC ^ -Xlog:gc*=debug:logs/gc.log:time,level,tags:filesize=10m,filecount=5 ^ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%PATH_HEAPDUMPFILE% ^ -XX:+CrashOnOutOfMemoryError ^ -XX:ErrorFile=%PATH_ERRORFILE% ^ -Dsun.net.inetaddr.ttl=100 ^ -Dspring.profiles.active=product ^ -Dspring.main.lazy-initialization=true ^ -XX:TieredStopAtLevel=1 ^ -jar lib\%WEBAPP_JAR%
ï¼åå®è¡ã㦠Started Application in ... seconds
ã«è¡¨ç¤ºãããæé㯠8.757ã9.071ã9.106ã9.106ã8.628ï¼å¹³å 8.9336ãï¼åç®ããâ¼6.815ãï¼åç®ããâ¼2.8878ï¼ã§ããã
2020-01-08 23:44:56.490 INFO 2728 --- [main] ksbysample.webapp.lending.Application : Starting Application on PC-02 with PID 2728 (D:\webapps\ksbysample-webapp-lending\lib\ksbysample-webapp-lending-2.2.2-RELEASE.jar started by root in D:\webapps\ksbysample-webapp-lending) 2020-01-08 23:44:56.494 INFO 2728 --- [main] ksbysample.webapp.lending.Application : The following profiles are active: product 2020-01-08 23:44:58.182 INFO 2728 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode! 2020-01-08 23:44:58.186 INFO 2728 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode. 2020-01-08 23:44:58.241 INFO 2728 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 34ms. Found 0 Redis repository interfaces. 2020-01-08 23:44:58.960 INFO 2728 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' of type [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:44:59.008 INFO 2728 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:44:59.574 INFO 2728 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:44:59.581 INFO 2728 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:44:59.588 INFO 2728 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@74d7184a' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:44:59.591 INFO 2728 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:44:59.605 INFO 2728 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-08 23:45:00.374 INFO 2728 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2020-01-08 23:45:00.392 INFO 2728 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-01-08 23:45:00.392 INFO 2728 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.29] 2020-01-08 23:45:00.483 INFO 2728 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-01-08 23:45:00.483 INFO 2728 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3901 ms 2020-01-08 23:45:01.188 INFO 2728 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 2020-01-08 23:45:02.203 INFO 2728 --- [springSessionRedisMessageListenerContainer-1] io.lettuce.core.EpollProvider : Starting without optional epoll library 2020-01-08 23:45:02.207 INFO 2728 --- [springSessionRedisMessageListenerContainer-1] io.lettuce.core.KqueueProvider : Starting without optional kqueue library 2020-01-08 23:45:04.128 INFO 2728 --- [main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing 2020-01-08 23:45:04.163 INFO 2728 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2020-01-08 23:45:04.167 INFO 2728 --- [main] ksbysample.webapp.lending.Application : Started Application in 8.757 seconds (JVM running for 9.346)
æéãããã£ã¦ããã¨æãããç®æãåãåºãã¦ã¿ã¾ããã
2020-01-08 23:44:58.182 INFO 2728 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
ï¼ç´1.5ç§â â â ï¼2020-01-08 23:45:00.374 INFO 2728 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
ï¼ç´1.7ç§â â â ï¼2020-01-08 23:45:01.188 INFO 2728 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService
ï¼ç´0.7ç§â â â ï¼2020-01-08 23:45:02.203 INFO 2728 --- [springSessionRedisMessageListenerContainer-1] io.lettuce.core.EpollProvider : Starting without optional epoll library
ï¼ç´1ç§â â â ï¼2020-01-08 23:45:04.128 INFO 2728 --- [main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
ï¼ç´2ç§â â ï¼
Multiple Spring Data modules found, entering strict repository configuration mode!
ã¨ã¯ï¼
以ä¸ã® Web ãã¼ã¸ã«ãã㨠Spring Data ç³»ã®ã¢ã¸ã¥ã¼ã«ãè¤æ°ä½¿ç¨ããã¦ããå ´åãstrict repository configuration mode ã«ãªãã¨ã®ãã¨ãä¾ãã°ãè¤æ°ã® Spring Data ç³»ã¢ã¸ã¥ã¼ã«ã使ç¨ãã¦ããå ´å CrudRepository ãç¶æ¿ããã ãã§ã¯ã©ã® Spring Data ãªã®ãå¤å¥ã§ããªããããåè³ã§ãããã
- Spring - Multiple Spring Data modules found, entering strict repository configuration mode
- 4.3.2. Using Repositories with Multiple Spring Data Modules
ããå°ã調ã¹ã¦ã¿ã㨠Spring Data Redis ã® Repository æ©è½ãè¦ã¤ãã¾ããã以ä¸ã® Web ãã¼ã¸ã«èª¬æãããã¾ãããªãã»ã©ãSpring Data ç³»ãªãã° Repository æ©è½ããããã§ãããSpring Data JPA ã ãã®æ©è½ã ã¨æã£ã¦ãã¾ããããã
Spring Data Redis 㯠Spring Session ã®ããã«ä½¿ç¨ãã¦ããã ããªã®ã§ -Dspring.data.redis.repositories.enabled=false
ã追å ã㦠Spring Data Redis ã® Repository æ©è½ãç¡å¹ã«ãã¦ã¿ã¾ãã
java -Xms1024m -Xmx1024m ^ -XX:MaxMetaspaceSize=384m ^ -XX:+UseG1GC ^ -Xlog:gc*=debug:logs/gc.log:time,level,tags:filesize=10m,filecount=5 ^ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%PATH_HEAPDUMPFILE% ^ -XX:+CrashOnOutOfMemoryError ^ -XX:ErrorFile=%PATH_ERRORFILE% ^ -Dsun.net.inetaddr.ttl=100 ^ -Dspring.profiles.active=product ^ -Dspring.main.lazy-initialization=true ^ -XX:TieredStopAtLevel=1 ^ -Dspring.data.redis.repositories.enabled=false ^ -jar lib\%WEBAPP_JAR%
ï¼åå®è¡ã㦠Started Application in ... seconds
ã«è¡¨ç¤ºãããæé㯠8.776ã8.37ã8.65ã8.627ã8.627ï¼å¹³å 8.61ï¼ã§ãããå°ãã ãçããªãã¾ãããç¡å¹ã«ããç¨ã§ã¯ãªãããã§ãã
2020-01-10 01:33:15.751 INFO 4628 --- [main] ksbysample.webapp.lending.Application : Starting Application on PC-02 with PID 4628 (D:\webapps\ksbysample-webapp-lending\lib\ksbysample-webapp-lending-2.2.2-RELEASE.jar started by root in D:\webapps\ksbysample-webapp-lending) 2020-01-10 01:33:15.755 INFO 4628 --- [main] ksbysample.webapp.lending.Application : The following profiles are active: product 2020-01-10 01:33:18.110 INFO 4628 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0' of type [org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-10 01:33:18.161 INFO 4628 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-10 01:33:18.688 INFO 4628 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-10 01:33:18.696 INFO 4628 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-10 01:33:18.703 INFO 4628 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@6e33c391' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-10 01:33:18.706 INFO 4628 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-10 01:33:18.722 INFO 4628 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2020-01-10 01:33:19.584 INFO 4628 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2020-01-10 01:33:19.608 INFO 4628 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-01-10 01:33:19.609 INFO 4628 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.29] 2020-01-10 01:33:19.707 INFO 4628 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-01-10 01:33:19.707 INFO 4628 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3868 ms 2020-01-10 01:33:20.371 INFO 4628 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 2020-01-10 01:33:21.572 INFO 4628 --- [springSessionRedisMessageListenerContainer-1] io.lettuce.core.EpollProvider : Starting without optional epoll library 2020-01-10 01:33:21.575 INFO 4628 --- [springSessionRedisMessageListenerContainer-1] io.lettuce.core.KqueueProvider : Starting without optional kqueue library 2020-01-10 01:33:23.394 INFO 4628 --- [main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing 2020-01-10 01:33:23.432 INFO 4628 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2020-01-10 01:33:23.436 INFO 4628 --- [main] ksbysample.webapp.lending.Application : Started Application in 8.776 seconds (JVM running for 9.375)
s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
ã®ãã°ããªãåºåãããã®ãï¼
ksbysample-webapp-lending ã§ã¯ @EnableScheduling
ã¢ããã¼ã·ã§ã³ãä»ä¸ã㦠Spring ã®ã¹ã±ã¸ã¥ã¼ãªã³ã°æ©è½ãæå¹ã«ãã¦ããªãã«ãããããããã¹ã±ã¸ã¥ã¼ãªã³ã°æ©è½ãæå¹ã«ãªã£ã¦ããã¨æããããã°ãåºã¦ãã¾ãã
ScheduledAnnotationBeanPostProcessor 㯠org.springframework.scheduling.annotation ããã±ã¼ã¸ã®ã¯ã©ã¹ã§ãããã¯ã©ã¹ã®ã³ã¡ã³ããè¦ã㨠Bean post-processor that registers methods annotated with @{@link Scheduled} ...
ã¨ããè¨è¿°ãããã¾ãã
ãFind in Pathãæ©è½ã§ EnableScheduling
ã§æ¤ç´¢ãã¦ã¿ãã¨ãorg.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration ã¯ã©ã¹ã®ä¸ã® SessionCleanupConfiguration ã¯ã©ã¹ã« @EnableScheduling
ã¢ããã¼ã·ã§ã³ãä»ä¸ããã¦ãã¾ããã
Spring Session 㧠Redis ä¸ã«ä¿åãããã»ãã·ã§ã³ãæå¹æéãåããå¾ã«åé¤ãããã®ã¯ Redis ã®æ©è½ã ã¨æã£ã¦ãã¾ããããSpring ã®ã¹ã±ã¸ã¥ã¼ãªã³ã°æ©è½ã§åé¤ããã¿ã¹ã¯ãå®æçï¼DEFAULT_CLEANUP_CRON = "0 * * * * *"
ï¼ã«å®è¡ããã¦ãã¾ããã
-Dspring.main.lazy-initialization=true
ãè¨å®ãã㨠/actuator/health
ãä½ãè¿ããªããªãï¼ï¼
Lazy Initialization in Spring Boot 2.2 ã«ãã㨠spring.main.lazy-initialization=true
ã¯éçºç°å¢ã§è¨å®ããã¨è¯ãã¨ã®ãã¨ã確ãã«èµ·åæéãç縮ãããã®ã¯é
åã§ãã
ãã㧠IntelliJ IDEA ã® Run/Debug Configuration ãã¤ã¢ãã°ãã VM Options ã« -Dspring.main.lazy-initialization=true
ãä»ãã¦ã¿ãã®ã§ããã
Spring Boot Actuator ã® Health Endpoint ã§ä½ã表示ãããªããªãã¾ããããããFailed to retrieve 'health' endpoint data: javax.management.InstanceNotFoundException: org.springframework.boot:type=Endpoint,name=Health
ã¨ããã¡ãã»ã¼ã¸ã表示ããã¾ãã
-Dspring.main.lazy-initialization=true
ãåé¤ããã¨åé¡ãªã表示ããã¾ãã
-Dspring.main.lazy-initialization=true
ãè¨å®ããæã« http://localhost:8080/actuator/health ã«ã¢ã¯ã»ã¹ããã¨ä½ãè¿ã£ã¦ããã®ã Postmanï¼curl ã GUI ã«ãããããªã¢ããªã§ãï¼ã§ç¢ºèªãã¦ã¿ãã¨ããããã°ã¤ã³ç»é¢ãè¿ã£ã¦ãã¦ãã¾ããã
æ°è¦ã« demo ã¢ããªï¼Spring Boot Actuator ãå°å ¥ï¼Spring Security ã¯å°å ¥ããªãï¼ãä½æãã¦åä½ã調æ»ãã¦ã¿ã¾ããã
- ksbysample-webapp-lending ã¨åæ§ã«
-Dspring.main.lazy-initialization=true
ãè¨å®ãã㨠IntelliJ IDEA ã® Health Endpoint ã«ã¯ä½ã表示ãããªãã - Postman ã§ã¢ã¯ã»ã¹ããã¨åé¡ãªããã¼ã¿ãåå¾ã§ããï¼
表示ãããªãæã®ã¡ãã»ã¼ã¸ã javax.management.InstanceNotFoundException
ã ã£ãã®ã§ã以ä¸ã® Bean ã追å ããã¨ãã demo ã¢ããªã§ã¯ IntelliJ IDEA ã® Health Endpoint ã«ãã¼ã¿ã表示ãããããã«ãªãã¾ããã
@Bean static LazyInitializationExcludeFilter jmxEndpointExporterLazyInitExcludeFilter() { return LazyInitializationExcludeFilter.forBeanTypes(JmxEndpointExporter.class); }
ksbysample-webapp-lending ã§ããã® Bean ã追å ããã° IntelliJ IDEA ã® Health Endpoint ã«ãã¼ã¿ã表示ãããããã«ãªãã¾ããããPostman 㧠http://localhost:8080/actuator/health ã«ã¢ã¯ã»ã¹ããæã«ãã°ã¤ã³ç»é¢ã表示ãããã®ã¯å¤ããã¾ããã§ããããï½ãããã£ã±ãåããã¾ããããã
æå¾ã«
ç縮ã§ããã¨ãã£ã¦ã 5ï½10ç§ç¨åº¦ã§ããWeb ã¢ããªãèµ·åå¾ã«å©ç¨å¯è½ã«ãªãããã«ãã¼ããã©ã³ãµã¼ã§ health check ããã¦ãããããªå ´åã«ã¯ãã¾ãã¡ãªããã¯ãªãæ°ããã¾ãã
-Dspring.main.lazy-initialization=true
ã¨ã¯é¢ä¿ããã¾ããããorg.springframework.boot:spring-boot-starter-data-redis
ï¼org.springframework.session:spring-session-data-redis
ãå°å ¥ããã¨ããããå¦çã追å ããã¦èµ·åæã«æéãããããã¨ãåããã¾ããã
å±¥æ´
2020/01/11
åççºè¡ã