<bean id="sendIns" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="cbrcCustomerInformationService"></property>
<property name="targetMethod" value="sendInstitutionalInformation"></property>
<property name="concurrent" value="false"></property>
</bean>
<!-- Trigger -->
<bean id="sendIn" class="org.springframework.scheduling.quartz.CronTriggerBean">
<!-- 定时器定时0点钟开始调用plBidCompensatoryService.calculateOverDueDays方法-->
<property name="cronExpression">
<value>0 * 9 * * ?</value>
</property>
<property name="jobDetail" ref="sendIns"/>
</bean>
<bean id="cbrcCustomerInformationService" class="com.zhiwei.credit.service.cbrc.impl.CbrcCustomerInformationServiceImpl">
<constructor-arg index="0" ref="cbrcCustomerInformationDao"/>
</bean>
Exception in thread "Timer-0" java.lang.NullPointerException
at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)
at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
在xml里写实在是 太冗长了,在方法上用@scheduled注解吧,然后为包含@Scheduled注解的类注册一个bean或者配置自动扫描