我试图建立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