[英]Connection with DB stuck spring boot jpa
When I build project it stucks on HikariPool-1 - Starting...当我构建项目时,它停留在 HikariPool-1 上 - 正在启动...
Here is full stacktrace:这是完整的堆栈跟踪:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.5.RELEASE)
2020-11-16 19:25:53.132 INFO 5328 --- [ restartedMain] pl.umcs.lessonwiz.LessonwizApplication : Starting LessonwizApplication on DESKTOP-4VPS8T4 with PID 5328 (C:\Users\admin\IdeaProjects\lessonwiz\build\classes\java\main starte
d by admin in C:\Users\admin\IdeaProjects\lessonwiz)
2020-11-16 19:25:53.135 INFO 5328 --- [ restartedMain] pl.umcs.lessonwiz.LessonwizApplication : No active profile set, falling back to default profiles: default
2020-11-16 19:25:53.180 INFO 5328 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2020-11-16 19:25:53.180 INFO 5328 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2020-11-16 19:25:53.688 INFO 5328 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2020-11-16 19:25:53.706 INFO 5328 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 11ms. Found 0 JPA repository interfaces.
2020-11-16 19:25:54.242 INFO 5328 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-11-16 19:25:54.256 INFO 5328 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-11-16 19:25:54.257 INFO 5328 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.39]
2020-11-16 19:25:54.351 INFO 5328 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-11-16 19:25:54.352 INFO 5328 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1172 ms
2020-11-16 19:25:54.434 INFO 5328 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
While debugging i get 3 messages in a loop:在调试时,我循环收到 3 条消息:
2020-11-16T19:36:12.936+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2020-11-16T19:36:12.936+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2020-11-16T19:36:12.936+0100 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
build.gradle构建.gradle
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.18'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
compileOnly 'org.projectlombok:lombok:1.18.16'
annotationProcessor 'org.projectlombok:lombok:1.18.16'
testCompileOnly 'org.projectlombok:lombok:1.18.16'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.16'
}
application.properties:应用程序属性:
spring.output.ansi.enabled=ALWAYS
spring.datasource.url=jdbc:postgresql://127.0.0.1:49888/postgres/postgres
spring.datasource.username=postgres
spring.datasource.password=kurwa123
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=create
pgPanel: Screenshot pgPanel:截图
Thanks for your answers谢谢你的回答
尝试更改application.properties
这些行。
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/postgres
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.