IDEA 开发 spring boot 应用程序 启动速度变慢,响应数据也慢
线上启动日志
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.4)
2023-11-21 22:00:29.730 INFO 1052 --- [ restartedMain] com.mall.MallApplication : Starting MallApplication using Java 1.8.0_371 on DESKTOP-FEMFKGD with PID 1052 (F:\Project\MallProject\maill\target\classes started by Dong in F:\Project\MallProject\maill)
2023-11-21 22:00:29.733 INFO 1052 --- [ restartedMain] com.mall.MallApplication : No active profile set, falling back to default profiles: default
2023-11-21 22:00:29.733 DEBUG 1052 --- [ restartedMain] o.s.boot.SpringApplication : Loading source class com.mall.MallApplication
2023-11-21 22:00:29.776 DEBUG 1052 --- [ restartedMain] o.s.b.devtools.restart.ChangeableUrls : Matching URLs for reloading : [file:/F:/Project/MallProject/maill/target/classes/]
2023-11-21 22:00:29.776 DEBUG 1052 --- [ restartedMain] o.s.b.d.settings.DevToolsSettings : Included patterns for restart : [/mybatis-plus-[\w-]+.jar]
2023-11-21 22:00:29.776 DEBUG 1052 --- [ restartedMain] o.s.b.d.settings.DevToolsSettings : Excluded patterns for restart : [/spring-boot-actuator/(bin|build|out)/, /spring-boot-devtools/(bin|build|out)/, /spring-boot/(bin|build|out)/, /spring-boot-starter-[\w-]+/, /spring-boot-autoconfigure/(bin|build|out)/, /spring-boot-starter/(bin|build|out)/]
2023-11-21 22:00:29.776 INFO 1052 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-11-21 22:00:29.776 INFO 1052 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-11-21 22:00:29.777 DEBUG 1052 --- [ restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@178beecf
2023-11-21 22:00:30.545 INFO 1052 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2023-11-21 22:00:30.546 INFO 1052 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-11-21 22:00:30.558 DEBUG 1052 --- [ restartedMain] o.s.b.a.AutoConfigurationPackages : @EnableAutoConfiguration was declared on a class in the package 'com.mall'. Automatic @Repository and @Entity scanning is enabled.
2023-11-21 22:00:30.567 INFO 1052 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 12 ms. Found 0 Redis repository interfaces.
2023-11-21 22:00:54.407 DEBUG 1052 --- [ restartedMain] .s.b.w.e.t.TomcatServletWebServerFactory : Code archive: C:\Users\Dong\.m2\repository\org\springframework\boot\spring-boot\2.5.4\spring-boot-2.5.4.jar
2023-11-21 22:00:54.413 DEBUG 1052 --- [ restartedMain] .s.b.w.e.t.TomcatServletWebServerFactory : Code archive: C:\Users\Dong\.m2\repository\org\springframework\boot\spring-boot\2.5.4\spring-boot-2.5.4.jar
2023-11-21 22:00:54.416 DEBUG 1052 --- [ restartedMain] .s.b.w.e.t.TomcatServletWebServerFactory : None of the document roots [src/main/webapp, public, static] point to a directory and will be ignored.
2023-11-21 22:01:46.914 INFO 1052 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http)
2023-11-21 22:01:47.133 INFO 1052 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-11-21 22:01:47.146 INFO 1052 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.52]
2023-11-21 22:01:52.513 INFO 1052 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-11-21 22:01:52.520 DEBUG 1052 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]
2023-11-21 22:01:52.526 INFO 1052 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 82749 ms
2023-11-21 22:01:54.655 DEBUG 1052 --- [ restartedMain] o.s.b.w.s.ServletContextInitializerBeans : Mapping filters: characterEncodingFilter urls=[/*] order=-2147483648, saPathCheckFilterForServlet urls=[/*] order=-1000
2023-11-21 22:01:54.658 DEBUG 1052 --- [ restartedMain] o.s.b.w.s.ServletContextInitializerBeans : Mapping servlets: dispatcherServlet urls=[/]
2023-11-21 22:01:55.113 DEBUG 1052 --- [ restartedMain] s.b.w.s.f.OrderedCharacterEncodingFilter : Filter 'characterEncodingFilter' configured for use
_ _ |_ _ _|_. ___ _ | _
| | |\/|_)(_| | |_\ |_)||_|_\
/ |
3.5.3.2
2023-11-21 22:02:16.613 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : This primary key of "id" is primitive !不建议如此请使用包装类 in Class: "com.mall.Entity.PageConfig.HomePage"
2023-11-21 22:02:19.579 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : This primary key of "id" is primitive !不建议如此请使用包装类 in Class: "com.mall.Entity.CompanyProfile"
2023-11-21 22:02:32.911 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : This primary key of "id" is primitive !不建议如此请使用包装类 in Class: "com.mall.Entity.PageConfig.CreditsExchange"
2023-11-21 22:02:44.883 INFO 1052 --- [ restartedMain] c.x.s.f.s.FileStorageAutoConfiguration : 加载存储平台:local-1
2023-11-21 22:02:58.734 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : This primary key of "id" is primitive !不建议如此请使用包装类 in Class: "com.mall.Entity.PageConfig.OrderEvaluation"
2023-11-21 22:03:02.733 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : This primary key of "id" is primitive !不建议如此请使用包装类 in Class: "com.mall.Entity.PageConfig.ProductSwipe"
2023-11-21 22:03:39.295 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : This primary key of "id" is primitive !不建议如此请使用包装类 in Class: "com.mall.Entity.MemberPkg.MembershipUpgrade"
2023-11-21 22:03:40.788 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : This primary key of "id" is primitive !不建议如此请使用包装类 in Class: "com.mall.Entity.MemberPkg.MembershipUpgradeTag"
2023-11-21 22:03:45.022 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : This primary key of "id" is primitive !不建议如此请使用包装类 in Class: "com.mall.Entity.ProblemFeedback"
2023-11-21 22:03:48.016 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : Can not find table primary key in Class: "com.mall.Entity.PageConfig.Area".
2023-11-21 22:03:48.021 WARN 1052 --- [ restartedMain] c.b.m.core.injector.DefaultSqlInjector : class com.mall.Entity.PageConfig.Area ,Not found @TableId annotation, Cannot use Mybatis-Plus 'xxById' Method.
2023-11-21 22:03:50.658 WARN 1052 --- [ restartedMain] c.b.m.core.metadata.TableInfoHelper : This primary key of "id" is primitive !不建议如此请使用包装类 in Class: "com.mall.Entity.Category"
2023-11-21 22:04:10.047 DEBUG 1052 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : 58 mappings in 'requestMappingHandlerMapping'
2023-11-21 22:04:17.838 DEBUG 1052 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Patterns [/**] in 'resourceHandlerMapping'
2023-11-21 22:04:21.086 DEBUG 1052 --- [ restartedMain] inMXBeanRegistrar$SpringApplicationAdmin : Application Admin MBean registered with name 'org.springframework.boot:type=Admin,name=SpringApplication'
2023-11-21 22:04:21.695 DEBUG 1052 --- [ restartedMain] o.s.b.d.livereload.LiveReloadServer : Starting live reload server on port 35729
2023-11-21 22:04:21.715 INFO 1052 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2023-11-21 22:04:22.443 DEBUG 1052 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : ControllerAdvice beans: 0 @ModelAttribute, 0 @InitBinder, 1 RequestBodyAdvice, 1 ResponseBodyAdvice
2023-11-21 22:04:24.054 DEBUG 1052 --- [ restartedMain] .m.m.a.ExceptionHandlerExceptionResolver : ControllerAdvice beans: 1 @ExceptionHandler, 1 ResponseBodyAdvice
____ ____ ___ ____ _ _ ____ _ _
[__ |__| __ | | | |_/ |___ |\ |
___] | | | |__| | \_ |___ | \|
https://sa-token.cc (v1.37.0)
2023-11-21 22:05:09.049 INFO 1052 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path ''
问题描述:
spring boot 启动很慢耗时将近5-10分钟 启动完毕,并且 在返回数据的时候 也很慢.
结论:
在 idea 中 找到断点 分析器,查看是不是有的源码上被打上了断点