gpt4 book ai didi

java - Spring Boot项目在Eclipse Debug模式下启动缓慢

转载 作者:行者123 更新时间:2023-12-02 09:20:07 25 4
gpt4 key购买 nike

我在Eclipse中基于mariadb、hibernate、spring-boot等常用库编写了一个Spring小项目。当我正常运行我的应用程序时,它在大约十秒内完成启动:

2019-11-07 19:53:47.539  INFO 2887 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.11.Final}
2019-11-07 19:53:47.541 INFO 2887 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2019-11-07 19:53:47.687 INFO 2887 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2019-11-07 19:53:47.799 INFO 2887 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MariaDB103Dialect
2019-11-07 19:53:55.078 INFO 2887 --- [ main] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@3400d6fa'
2019-11-07 19:53:55.083 INFO 2887 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-11-07 19:53:55.336 INFO 2887 --- [ main] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
2019-11-07 19:53:55.681 INFO 2887 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-11-07 19:53:55.706 WARN 2887 --- [ main] 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
2019-11-07 19:53:55.893 INFO 2887 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-11-07 19:53:55.897 INFO 2887 --- [ main] petmenu.Application : Started Application in 10.373 seconds (JVM running for 11.18)

当我在 Debug模式下启动它时,需要十倍的时间。

2019-11-07 19:36:40.265  INFO 2108 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.3.11.Final}
2019-11-07 19:36:40.267 INFO 2108 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2019-11-07 19:36:40.615 INFO 2108 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2019-11-07 19:36:40.792 INFO 2108 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MariaDB103Dialect
2019-11-07 19:36:48.625 INFO 2108 --- [ main] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@57afe44b'
2019-11-07 19:36:48.628 INFO 2108 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-11-07 19:36:48.972 INFO 2108 --- [ main] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
2019-11-07 19:37:44.033 INFO 2108 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-11-07 19:37:51.931 WARN 2108 --- [ main] 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
2019-11-07 19:38:19.658 INFO 2108 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-11-07 19:38:19.722 INFO 2108 --- [ main] petmenu.Application : Started Application in 103.693 seconds (JVM running for 105.206)

我注意到这个任务特别需要几乎一分钟,而在正常启动时它是瞬时的。

2019-11-07 19:36:48.972  INFO 2108 --- [           main] o.h.h.i.QueryTranslatorFactoryInitiator  : HHH000397: Using ASTQueryTranslatorFactory

最佳答案

我在运行下选择跳过所有断点选项或按(CTRL+ALT+B)作为快捷键。对于我的 STS, Debug模式启动比以前更快

第 1 步:一旦我们应用(CTRL+ALT+B)断点被禁用,然后启动你的服务器,它将快速运行。

第 2 步:再次使用相同的快捷方式启用断点,然后您就可以进行调试。

注意:除非应用Step2,否则我们无法调试应用程序。

关于java - Spring Boot项目在Eclipse Debug模式下启动缓慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58755421/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com