我試圖建立CronTriggerFactoryBeanusing Spring
,它有一個屬性 名的JobDetail這我試圖initalize。如何爲org.quartz.JobDetail創建自定義編輯器?
<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>
但我正在逐漸誤差
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.
我認爲這需要String
作爲默認類型。我想看一下[propertyeditors][1]
。我想我需要使用ClassEditor
我是否認爲正確?
我如何刪除此錯誤? 如何爲此創建自定義編輯器?
在此先感謝。
根據錯誤描述 – 2012-07-26 13:40:44
他們應該不會造成問題Thanks.I想我會的正確的方法。但我對** targetMethod **有疑問?這裏我應該寫些什麼。我可以把它放空嗎? – vikiiii 2012-07-27 05:05:24
在MethodInvokingJobDetailFactoryBean的特定情況下,targetMethod是spring將在用戶指定的bean上調用的對象的方法(exampleBusinessObject) – 2012-07-27 06:55:53