반응형
Spring Boot Quartz 를 사용하여 Job Store를 특정 Data Base로 지정하여 사용 하거나
Spring Boot 의 기본 DataSource ("spring.datasoure.url =" )를 사용하지 않고
별도로 지정하여서 사용을 할 경우
Failed to instantiate [org.quartz.Scheduler]: Factory method 'schedulerFactoryBean' threw exception; nested exception is org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'xxxxDataSource': java.sql.SQLException: There is no DataSource named 'xxxxDataSource'
See nested exception: java.sql.SQLException: There is no DataSource named 'xxxxxDataSource'
와 같은 에러가 발생 한다.
소스를 받아서 디버깅을 해 보면
이것은 DataSource의 명칭이 불일치 하여 발생한 에러 이다.
"quartz.properties" 파일의 설정을 아래와 같이 조정하기 바란다.
위의 그림과 같이 "org.quzrtz.dataSource"의 값과 "org.quzrtz.data." 하위 Properties 이름이 일치하여야 한다.
( "org.quzrtz.dataSource" 는 Spring Boot에서 생성되는 Java Data Source Instance 명이 아님을 알수 있다 )
# Quartz Job Store
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
org.quartz.jobStore.dataSource = quartzDataSource
org.quartz.jobStore.misfireThreshold=60000
org.quartz.jobStore.tablePrefix=QRTZ_
org.quartz.jobStore.isClustered=false
#Quartz Data Source
org.quartz.dataSource.quartzDataSource.URL=jdbc:postgresql://localhost:5432/yacesbdb
org.quartz.dataSource.quartzDataSource.driver=org.postgresql.Driver
org.quartz.dataSource.quartzDataSource.user=auser
org.quartz.dataSource.quartzDataSource.password=auserpass!
org.quartz.dataSource.quartzDataSource.provider=hikaricp
반응형
'개발하면서' 카테고리의 다른 글
PostgreSQL 성능을 위한 설정 ( postgresql.conf 설정 ) (0) | 2023.01.29 |
---|---|
JEUS8 Spring SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder". (1) | 2022.11.30 |
npm ERR! code ELIFECYCLE (0) | 2022.03.17 |
Node.js, NPM (Node Package Manager) 설치하기 (0) | 2022.03.08 |
Eclipse에서 Mybatis Generator 사용하기 (0) | 2021.08.28 |