做了一个定时任务,但是在运行的时候总是报错:XmlToTableTask 中的IHrmisBiz_为空public class XmlToTableTask { private IHrmisBiz IHrmisBiz_; private static boolean isRunning = false; public void run() { if (!isRunning) {
isRunning = true;
try {
List list = this.IHrmisBiz_.parseXml();---空指针异常
this.IHrmisBiz_.wirteDB(list);
} catch (Exception e) {
} isRunning = false;
} else {
Log.debug("上一次任务执行还未结束..."); // 上一次任务执行还未结束
}
} /**
* @return the iHrmisBiz_
*/
public IHrmisBiz getIHrmisBiz_() {
return IHrmisBiz_;
} /**
* @param hrmisBiz_
* the iHrmisBiz_ to set
*/
public void setIHrmisBiz_(IHrmisBiz hrmisBiz_) {
IHrmisBiz_ = hrmisBiz_;
}
}
<bean name="XmlToTableTask"
class="cmcc.interfaces.hrmis.task.XmlToTableTask">
<property name="IHrmisBiz_">
<ref bean="HrmisBiz" />
</property>
</bean> <bean name="HrmisBiz" class="cmcc.interfaces.hrmis.biz.HrmisBiz">
<property name="IHrmisDao_">
<ref bean="HrmisDao" />
</property>
</bean> <bean name="HrmisDao" class="cmcc.interfaces.hrmis.dao.HrmisDao">
<property name="jdbcTemplate">
<ref bean="jdbcTemplate" />
</property>
</bean> <bean id="methodInvokingJobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="XmlToTableTask" />
</property>
<property name="targetMethod">
<value>run</value>
</property>
</bean> <bean id="cronTrigger"
class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="methodInvokingJobDetail" />
</property>
<property name="cronExpression">
<!-- 每个月25日 23点30分触发
<value>0 30 23 25 * ?</value>-->
<value>1 * * * * ?</value>
</property>
</bean> <bean
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="cronTrigger" />
</list>
</property>
</bean>是我哪里配置错了,请指教。
解决方案 »
- 请教分页查询 修改 页面跳转问题
- 现场直憋啊!
- 请教EJB中的事务机制是否对文件读写起作用?
- 初学者关于一个hibernate和spring的问题!
- struts中引入javascript问题
- java怎样把查询数据库的结果压缩成xml文件谢谢
- 怎样实现WEB页面定制短信心服务,如何socket消息传送?
- 我在weblogic中怎么连最简单的jsp都运行不了???(在线等)
- 求救:!!!!我用了2年的QQ号码被一个无耻的人盗,高手帮忙,
- jsp页面如何将输入的用户名和密码传递给EJB,通过EJB在数据库里验证数据(数据库中已有的数据)
- java.util.ConcurrentModificationException的异常
- 回帖用回点不?
<ref bean="HrmisBiz" />
</property>
ref是子元素??好象ref是property的属性来的吧??
试
<property name="IHrmisBiz_" ref="HrmisBiz"/>
<property name="jobClass" value="com.pracbiz.zuellig.rdc.job.ImportBDJob" />
<property name="jobDataAsMap">
<map>
<entry key="emailEngine" value-ref="emailEngine" />
<entry key="appConfig" value-ref="appConfig" />
<entry key="backendJobAppConfig" value-ref="backendJobAppConfig" />
<entry key="messageSource" value-ref="messageSource" />
<entry key="principalService" value-ref="principalService"/>
<entry key="commonSDSService" value-ref="commonSDSService" />
<entry key="businessDivisionService" value-ref="businessDivisionService" />
<entry key="systemCodeService" value-ref="systemCodeService" />
<entry key="dateUtil" value-ref="dateUtil" />
</map>
</property>
</bean>