반응형
spring 3.2 No setter found for property 'cronExpression' in class
Quartz Scheduler 2.x 적용 중 다음과 같은 오류 발생
spring 3.2 No setter found for property 'cronExpression' in class
해결
spring reference에 나와있는 CronTriggerBean 대신 CronTriggerFactoryBean class를 사용함
1
2
3
4
5 |
< bean class = "org.springframework.scheduling.quartz.CronTriggerBean" id = "cronTrigger" > < property ref = "exampleJob" name = "jobDetail" > <!-- run every morning at 6 AM --> < property name = "cronExpression" value = "0 0 6 * * ?" > </ property ></ property ></ bean > |
대신에 아래와 같이 CronTriggerFactoryBean을 사용함.
1
2
3
4
5 |
< bean class = "org.springframework.scheduling.quartz.CronTriggerFactoryBean" id = "cronTrigger" > < property ref = "exampleJob" name = "jobDetail" > <!-- run every morning at 6 AM --> < property name = "cronExpression" value = "0 0 6 * * ?" > </ property ></ property ></ bean > |
참고
If You are using Spring 3.x & Quartz 2.1.x…
Then do only two changes IN YOUR configuration file 1st : for Simple Trigger
Use class=”org.springframework.scheduling.quartz.SimpleTriggerFactoryBean”> instead of class=”org.springframework.scheduling.quartz.SimpleTriggerBean”>
2nd : for Cron Trigger useclass=”org.springframework.scheduling.quartz.CronTriggerFactoryBean” instead ofclass=”org.springframework.scheduling.quartz.CronTriggerBean”
출처 :http://shuiky.tistory.com/728