HikariPool-1 - driverClassName에는 jdbcUrl이 필요합니다.
예전 프로그램인 https://github.com/JonkiPro/REST-Web-Services로 다시 돌아갔습니다.Spring Boot을 버전 15.6에서 버전 2.0.0으로 업데이트했습니다.컴파일에 많은 문제가 발생했지만, 대응할 수 없습니다.컴파일하는 동안 날 콘솔로 던지고
2018-03-18 21:54:53.339 ERROR 3220 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig : HikariPool-1 - jdbcUrl is required with driverClassName.
2018-03-18 21:54:55.392 INFO 3220 --- [ost-startStop-1] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'unit'
2018-03-18 21:54:56.698 INFO 3220 --- [ost-startStop-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'unit'
2018-03-18 21:54:56.778 ERROR 3220 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig : HikariPool-1 - jdbcUrl is required with driverClassName.
2018-03-18 21:54:56.782 ERROR 3220 --- [ost-startStop-1] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService' defined in file [C:\Users\Jonatan\Documents\GitHub\REST-Web-Services\web\out\production\classes\com\web\web\security\service\impl\UserDetailsServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)#65d6e77b' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#65d6e77b': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': Post-processing of FactoryBean's singleton object failed; nested exception is java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName.
2018-03-18 21:54:56.821 WARN 3220 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
나는 그런 실수를 한 적이 없다.나는 그것이 완전히 무엇을 의미하는지 모른다.기지에 대한 내 속성은 다음과 같습니다.
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql:database
username: root
password: root
schema: classpath:/db/init/schema.sql
나는 이 오류에 어떻게 대처해야 할지 모르겠다.꽤 오랫동안 프로그래밍을 해왔지만, 처음으로 이 컨셉을 충족하게 되었습니다.hikariTomcat(Spring Boot) 서버와 Postgre를 사용하고 있습니다.SQL 데이터베이스
다른 맥락에서도 같은 문제가 있었습니다.79년부터요. 데이터 액세스 - 커스텀 데이터 소스 구성
클래스 패스에 Hikari가 있는 경우 Hikari에는 URL 속성이 없기 때문에 이 기본 설정은 기능하지 않습니다(단, jdbcUrl 속성은 있습니다).
봄 부트 2에서는 Hikari가 디폴트풀입니다.
이 때문에, 설정을 치환할 수 있습니다.url: jdbc:postgresql:database->jdbc-url: jdbc:postgresql:database
또는 설정을 유지할 수 있지만 매핑(에일리어스)을 처리하기 위해 다른 Bean을 정의해야 합니다.
@Bean
@Primary
@ConfigurationProperties("app.datasource")
public DataSourceProperties dataSourceProperties() {
return new DataSourceProperties();
}
@Bean
@ConfigurationProperties("app.datasource")
public DataSource dataSource(DataSourceProperties properties) {
return properties.initializeDataSourceBuilder().
.build();
}
둘 중 하나 제거spring.datasource.driver-class-name속성 또는 이름 변경spring.datasource.url의 재산.spring.datasource.jdbc-url.
이것은, 에러로 보고됩니다.
java.displaces를 클릭합니다.부정 인수예외: driverClassName에는 jdbcUrl이 필요합니다.
첫 번째 옵션은 보다 깔끔해 보이고 Spring Boot은 기본 드라이버 클래스 이름을 확인합니다.spring.datasource.url속성값( 참조)org.springframework.boot.jdbc.DatabaseDriverclass(이것을 디버깅하는 경우)를 클릭합니다.
언급URL : https://stackoverflow.com/questions/49352800/hikaripool-1-jdbcurl-is-required-with-driverclassname
'programing' 카테고리의 다른 글
| Angularjs를 사용하려면 node.js가 필요합니까? (0) | 2023.04.04 |
|---|---|
| 동일한 페이지/루트에 동일한 재사용 가능한 레덕스 반응 컴포넌트의 여러 인스턴스가 있는 경우 (0) | 2023.04.04 |
| 날짜 형식을 angularjs로 지정하는 방법 (0) | 2023.04.04 |
| url 파라미터로 전달된 로그인 파라미터 해결 비활성화 방법 / url에서 (0) | 2023.04.04 |
| Redx Reducer 내부의 상태에 액세스하는 방법 (0) | 2023.04.04 |