Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 升级到Spring Boot 2.2.2后,应用程序启动时间变慢_Spring Boot - Fatal编程技术网

Spring boot 升级到Spring Boot 2.2.2后,应用程序启动时间变慢

Spring boot 升级到Spring Boot 2.2.2后,应用程序启动时间变慢,spring-boot,Spring Boot,我将应用程序升级到SpringBoot2.2.2,现在启动时间在30秒范围内 :: Built with Spring Boot :: 2.2.2.RELEASE 2019-12-23 10:38:06.822 INFO 4669 --- [ restartedMain] c.d.l.i.r.IdeaSubmissionRestApplication : Starting IdeaSubmissionRestApplication on wsm-93.local with PID 4669

我将应用程序升级到SpringBoot2.2.2,现在启动时间在30秒范围内

:: Built with Spring Boot :: 2.2.2.RELEASE
2019-12-23 10:38:06.822  INFO 4669 --- [  restartedMain] c.d.l.i.r.IdeaSubmissionRestApplication  : Starting IdeaSubmissionRestApplication on wsm-93.local with PID 4669 (/Users/mhast/Developer/sts_workspaces_4_4_1/dss/ldrd_s/IdeaSubmissionRest/target/classes started by mhast in /Users/mhast/Developer/sts_workspaces_4_4_1/dss/ldrd_s/IdeaSubmissionRest)
2019-12-23 10:38:06.826  INFO 4669 --- [  restartedMain] c.d.l.i.r.IdeaSubmissionRestApplication  : The following profiles are active: dev
...
2019-12-23 10:38:08.440  INFO 4669 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8320 (http)
2019-12-23 10:38:08.447  INFO 4669 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-12-23 10:38:08.448  INFO 4669 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.29]
2019-12-23 10:38:08.512  INFO 4669 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-12-23 10:38:08.512  INFO 4669 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1530 ms
2019-12-23 10:38:08.678  INFO 4669 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2019-12-23 10:38:09.189  INFO 4669 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2019-12-23 10:38:09.234  INFO 4669 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2019-12-23 10:38:09.285  INFO 4669 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate Core {5.4.9.Final}
2019-12-23 10:38:09.370  INFO 4669 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2019-12-23 10:38:09.456  INFO 4669 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect
2019-12-23 10:38:37.903  INFO 4669 --- [  restartedMain] org.hibernate.tuple.PojoInstantiator     : HHH000182: No default (no-argument) constructor for class: com.desertsky.ldrd.model.entities.FrsFactTableViewId (class must be instantiated by Interceptor)
2019-12-23 10:38:39.038  INFO 4669 --- [  restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2019-12-23 10:38:39.043  INFO 4669 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-12-23 10:38:40.109  WARN 4669 --- [  restartedMain] 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
加载Oracle10gDialogue从10:38:09.456开始,下一个日志是28秒后

2019-12-23 10:38:09.456  INFO 4669 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect
2019-12-23 10:38:37.903  INFO 4669 --- [  restartedMain] org.hibernate.tuple.PojoInstantiator     : HHH000182: No default (no-argument) constructor for class: com.desertsky.ldrd.model.entities.FrsFactTableViewId (class must be instantiated by Interceptor)

有人知道为什么升级到Spring Boot 2.2.2后方言加载如此缓慢吗?

我在这篇文章中找到了答案

我已将此属性添加到application.properties文件中,现在又可以快速启动应用程序了

spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
JBoss Hibernate文档说:

This setting is used to control whether we should consult the JDBC metadata to determine certain Settings default values when the database may not be available (mainly in tools usage).