<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <import resource="applicationContext_sqlIMSKING.xml" /> <!-- 属性文件读入 -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:db_IMSKING.properties</value>
</list>
</property>
</bean> <!-- 数据源定义,使用c3p0 连接池 -->
<bean id="quartzdataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="${imsking.jdbc.driverClassName}" />
<property name="jdbcUrl" value="${imsking.jdbc.url}" />
<property name="user" value="${imsking.jdbc.username}" />
<property name="password" value="${imsking.jdbc.password}" />
<property name="initialPoolSize" value="${cpool.minPoolSize}" />
<property name="minPoolSize" value="${cpool.minPoolSize}" />
<property name="maxPoolSize" value="${cpool.maxPoolSize}" />
<property name="acquireIncrement" value="${cpool.acquireIncrement}" />
<property name="maxIdleTime" value="${cpool.maxIdleTime}" />
</bean>
<bean name="quartzScheduler"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="dataSource" ref="quartzdataSource" />
<property name="applicationContextSchedulerContextKey" value="applicationContextKey" />
<property name="configLocation" value="classpath:quartz.properties" />
</bean>
<bean name="simpleService" class="optima.frame.plan.model.SimpleService"> </bean>
<bean id="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>
optima.frame.plan.model.MyQuartzJobBean
</value>
</property>
<property name="jobDataAsMap">
<map>
<entry key="simpleService">
<ref bean="simpleService" />
</entry>
</map>
</property>
</bean> <!-- 排程管理 -->
<bean name="quartzDao" class="optima.frame.plan.dao.impl.QuartzDaoImpl">
<property name="hibernateTemplate" ref="hibernateTemplate"></property>
</bean>
<bean name="schedulerModel" class="optima.frame.plan.model.SchedulerModelImpl">
<property name="jobDetail">
<ref bean="jobDetail" />
</property>
<property name="scheduler">
<ref bean="quartzScheduler" />
</property>
<property name="quartzDao">
<ref bean="quartzDao" />
</property>
</bean>
<bean name="quartzquery" class="optima.frame.plan.action.QuartzsAction">
<property name="schedulerModel">
<ref bean="schedulerModel" />
</property>
</bean>
</beans>
上面是我的动态加载任务的配置,如何把动态加载的任务按照有状态的执行,(有状态的任务不能并发执行,无状态的任务可并发执行)就是把这句<property name="concurrent" value="false" /> ③ 指定最终封装出的任务是否有状态,加在那里quartzconcurrent并发动态加载有状态的

解决方案 »

  1.   


    Error creating bean with name 'jobDetail' defined in ServletContext resource [/WEB-INF/classes/applicationContext_quartz.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'concurrent' of bean class [org.springframework.scheduling.quartz.JobDetailBean]: Bean property 'concurrent' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
      

  2.   

    <bean id="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">放在这个标签下试试