有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java SpringBoot应用程序仅在调试模式下启动需要很长时间

我不明白为什么我的spring boot应用程序在常规模式下运行时需要15秒才能启动,而在调试模式下运行时需要15分钟

调试模式日志:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.3.RELEASE)

2020-02-28 16:57:27.214  INFO [my-project,,,] 5740 --- [  restartedMain] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : https://config-server.my-company.org
2020-02-28 16:57:29.442  INFO [my-project,,,] 5740 --- [  restartedMain] c.c.c.ConfigServicePropertySourceLocator : Located environment: name=my-project, profiles=[dev], label=null, version=c656a6ca556f4fc58135e673a7e5c4e97a2e5088, state=null
2020-02-28 16:57:33.537  INFO [my-project,,,] 5740 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-02-28 16:57:33.537  INFO [my-project,,,] 5740 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4023 ms
2020-02-28 16:57:37.986  INFO [my-project,,,] 5740 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-02-28 17:00:22.158  INFO [my-project,,,] 5740 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2020-02-28 17:02:21.271  WARN [my-project,,,] 5740 --- [  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
2020-02-28 17:03:37.441  INFO [my-project,,,] 5740 --- [  restartedMain] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 16 endpoint(s) beneath base path '/actuator'
2020-02-28 17:04:22.272  INFO [my-project,,,] 5740 --- [  restartedMain] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
2020-02-28 17:04:58.404  WARN [my-project,,,] 5740 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2020-02-28 17:04:58.416  INFO [my-project,,,] 5740 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-02-28 17:04:58.753  WARN [my-project,,,] 5740 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2020-02-28 17:04:58.765  INFO [my-project,,,] 5740 --- [  restartedMain] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-02-28 17:05:58.718  INFO [my-project,,,] 5740 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-02-28 17:07:05.596  INFO [my-project,,,] 5740 --- [  restartedMain] o.e.s.filters.AnnotationSizeOfFilter     : Using regular expression provided through VM argument org.ehcache.sizeof.filters.AnnotationSizeOfFilter.pattern for IgnoreSizeOf annotation : ^.*cache\..*IgnoreSizeOf$
2020-02-28 17:07:29.728  INFO [my-project,,,] 5740 --- [  restartedMain] c.my-company.security.idp.BeanFactory   : override default IdpOAuthManager userInfoCallDisabled = true, IdpUser will only contains uid
2020-02-28 17:08:24.056  INFO [my-project,,,] 5740 --- [  restartedMain] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService
2020-02-28 17:09:58.919  INFO [my-project,,,] 5740 --- [  restartedMain] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: any request org.springframework.web.filter.CorsFilter@7430bc1e,
2020-02-28 17:12:03.101  INFO [my-project,,,] 5740 --- [  restartedMain] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2020-02-28 17:12:05.749  INFO [my-project,,,] 5740 --- [  restartedMain] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s) org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@69e6f894]
2020-02-28 17:12:17.850  INFO [my-project,,,] 5740 --- [  restartedMain] s.d.s.w.s.ApiListingReferenceScanner     : Scanning for api listing references
2020-02-28 17:13:54.484  INFO [my-project,,,] 5740 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2020-02-28 17:13:54.837  INFO [my-project,,,] 5740 --- [  restartedMain] c.d.i.b.p.MySpringBootApplication      : Started MySpringBootApplication in 988.725 seconds (JVM running for 989.776)
2020-02-28 17:14:17.835  INFO [my-project,,,] 5740 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 6879 ms
2020-02-28 17:14:35.004  INFO [my-project,b5277242974c5225,b5277242974c5225,false] 5740 --- [nio-8080-exec-1] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : https://config-server.my-company.org
2020-02-28 17:14:42.858  INFO [my-project,b5277242974c5225,b5277242974c5225,false] 5740 --- [nio-8080-exec-1] c.c.c.ConfigServicePropertySourceLocator : Located environment: name=my-project, profiles=[dev], label=null, version=c656a6ca556f4fc58135e673a7e5c4e97a2e5088, state=null

任何帮助或解释都将不胜感激

谢谢


共 (2) 个答案

  1. # 1 楼答案

    断点或条件断点通常会导致此问题。删除所有断点并运行它

  2. # 2 楼答案

    您可能在方法调用上有一个断点,如果您可以尝试将断点放在方法中的第一行代码上,那么这些断点会使Java应用程序的速度降低很多