简体   繁体   中英

Intellij not update the spring.datasource.url

I migrated my project from sts to intellij, but the intllij not update the connection database with application.properties -> spring.datasource.url , not working

log of console:

2019-06-28 15:52:27.593 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : MatdmJPAHikariCP - configuration:
2019-06-28 15:52:27.596 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : allowPoolSuspension.............false
2019-06-28 15:52:27.597 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : autoCommit......................true
2019-06-28 15:52:27.597 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : catalog.........................null
2019-06-28 15:52:27.597 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : connectionInitSql...............null
2019-06-28 15:52:27.597 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : connectionTestQuery.............null
2019-06-28 15:52:27.597 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : connectionTimeout...............30000
2019-06-28 15:52:27.597 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : dataSource......................null
2019-06-28 15:52:27.597 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : dataSourceClassName.............null
2019-06-28 15:52:27.597 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : dataSourceJNDI..................null
2019-06-28 15:52:27.599 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : dataSourceProperties............{password=<masked>}
2019-06-28 15:52:27.599 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : driverClassName................."org.postgresql.Driver"
2019-06-28 15:52:27.600 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : healthCheckProperties...........{}
2019-06-28 15:52:27.600 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : healthCheckRegistry.............null
2019-06-28 15:52:27.600 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : idleTimeout.....................30000
2019-06-28 15:52:27.600 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : initializationFailFast..........true
2019-06-28 15:52:27.600 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : isolateInternalQueries..........false
2019-06-28 15:52:27.600 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : jdbc4ConnectionTest.............false
2019-06-28 15:52:27.600 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : jdbcUrl........................."jdbc:postgresql://localhost:5432/meuatendimento"
2019-06-28 15:52:27.601 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : leakDetectionThreshold..........0
2019-06-28 15:52:27.601 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : maxLifetime.....................2000000
2019-06-28 15:52:27.601 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : maximumPoolSize.................20
2019-06-28 15:52:27.601 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : metricRegistry..................null
2019-06-28 15:52:27.601 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : metricsTrackerFactory...........null
2019-06-28 15:52:27.601 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : minimumIdle.....................5
2019-06-28 15:52:27.601 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : password........................<masked>
2019-06-28 15:52:27.601 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : poolName........................"MatdmJPAHikariCP"
2019-06-28 15:52:27.601 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : readOnly........................false
2019-06-28 15:52:27.602 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : registerMbeans..................false
2019-06-28 15:52:27.602 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : scheduledExecutorService........null
2019-06-28 15:52:27.602 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : threadFactory...................null
2019-06-28 15:52:27.602 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : transactionIsolation............null
2019-06-28 15:52:27.602 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : username........................null
2019-06-28 15:52:27.602 DEBUG 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig           : validationTimeout...............5000
2019-06-28 15:52:27.602  INFO 78161 --- [ost-startStop-1] com.zaxxer.hikari.HikariDataSource       : MatdmJPAHikariCP - Started.
2019-06-28 15:52:27.733  INFO 78161 --- [ost-startStop-1] com.zaxxer.hikari.pool.PoolBase          : MatdmJPAHikariCP - Driver does not support get/set network timeout for connections. (Método org.postgresql.jdbc.PgConnection.getNetworkTimeout() ainda não foi implementado.)
2019-06-28 15:52:27.997  INFO 78161 --- [ost-startStop-1] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'

but in my code it's so:

spring.datasource.url=jdbc:postgresql://localhost:5432/newdb
spring.datasource.username=username
spring.datasource.password=pass
spring.datasource.tomcat.max-active=40
spring.datasource.tomcat.max-idle=40
spring.datasource.tomcat.min-idle=40
jpa.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.datasource.driver-class-name=org.postgresql.Driver
org.springframework.boot = spring-boot-starter-jersey

# Hikari will use the above plus the following to setup connection pooling
spring.datasource.hikari.minimumIdle=5
spring.datasource.hikari.maximumPoolSize=20
spring.datasource.hikari.idleTimeout=30000
spring.datasource.hikari.poolName=MatdmJPAHikariCP
spring.datasource.hikari.maxLifetime=2000000
spring.datasource.hikari.connectionTimeout=30000

I cleaned cache of Intellij, but it is not working.

For the Hikari connection pool, the url property is jdbc-url, not url. So change

spring.datasource.url=jdbc:postgresql://localhost:5432/newdb to

spring.datasource.jdbc-url=jdbc:postgresql://localhost:5432/newdb

For more info, and other possible solutions see: After Spring Boot 2.0 migration: jdbcUrl is required with driverClassName

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM