I am trying to set up the CronTriggerFactoryBeanusing Spring and it has a property named JobDetail which I am trying to initialise.
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="name" value="NTrigger"></property>
<property name="group" value="Group Trigger"></property>
<property name="jobDetail" value="Group Trigger"></property>
<property name="cronExpression" value="${quartz.slaPollerCronExpression.timeInterval}"></property>
</bean>
But I am getting an error as:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'cronTriggerForSLAPoller' defined in ServletContext resource [/WEB-INF/config/quartz
-config.xml]: Initialization of bean failed; nested exception is
org.springframework.beans.ConversionNotSupportedException: Failed to convert property value
of type 'java.lang.String' to required type 'org.quartz.JobDetail' for property
'jobDetail'; nested exception is java.lang.IllegalStateException:
Cannot convert value of type [java.lang.String] to required type [org.quartz.JobDetail
for property 'jobDetail': no matching editors or conversion strategy found.
I think it takes String as a default type.
I have a look at the [propertyeditors][1]. I think I will need to use ClassEditor. Am I thinking correct?
How can I remove this error? How can I create a custom editor for this?
It seems you need to pass a reference instead of a string:
CronTriggerFactoryBean
See Chapter 23. Scheduling and Thread Pooling.