问个spring任务调度的问题,用spring+quartz实现定时发邮件,发邮件类autoSendingMailJob在main里能正常工作,而单单独测试quartz框架system.out也能正常打出,就是把new autoSendingMailJob().start() 放入quartz的executeInternal方法中执行的时候就会抛出
invalid SHA1 signature file digest for javax/activation/DataContentHandlerFactory.class异常,是什么问题呢 请高手指教以下是我的测试任务在ecuteInternal调用spring注入的发邮件的组件public class TestJob extends QuartzJobBean{
public static Logger log = Logger.getLogger(TestJob.class); private autoSendingMailJob asmj;
public void setAsmj(autoSendingMailJob asmj) {
this.asmj = asmj;
} protected void executeInternal(JobExecutionContext arg0)
throws JobExecutionException {
// TODO Auto-generated method stub
try {
log.info("自动发送邮件任务开始>........");
asmj.start();
log.info("自动发送邮件任务结束!");
} catch (Exception e) {
log.error("自动发送邮件任务出现异常", e);
}
}
invalid SHA1 signature file digest for javax/activation/DataContentHandlerFactory.class异常,是什么问题呢 请高手指教以下是我的测试任务在ecuteInternal调用spring注入的发邮件的组件public class TestJob extends QuartzJobBean{
public static Logger log = Logger.getLogger(TestJob.class); private autoSendingMailJob asmj;
public void setAsmj(autoSendingMailJob asmj) {
this.asmj = asmj;
} protected void executeInternal(JobExecutionContext arg0)
throws JobExecutionException {
// TODO Auto-generated method stub
try {
log.info("自动发送邮件任务开始>........");
asmj.start();
log.info("自动发送邮件任务结束!");
} catch (Exception e) {
log.error("自动发送邮件任务出现异常", e);
}
}
解决方案 »
- POI与jxl.jar性能大揭秘
- 关于java就业方向的问题
- JAVA如何全程追踪项目然后打印到文本文件,急
- Map
- flex实现树形菜单栏特效(上下,左右伸展)
- 近来log4j使用过程中的怪事情。。。
- 救命!我写了一个SessionBean实例,代码 布署已经完全正常,显示时有误,不知是何错
- poi中文sheet名乱码的问题
- 从一个页面传过来一个文件(以流的方式传过来的),我怎么在这个页面接收并下载这个文件呢?
- 请问在JAVA里如何将字符型转化为日期型?
- struts下的jsp 异常 java.lang.NullPointerException
- 学会的东西越来越多,但是却越来越迷忙,希望Java高手给指条明路
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="autoSendingMailJob"
class="com.newWebSite.util.autoJob.autoSendingMailJob" /> <bean name="verifyJob"
class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>com.newWebSite.util.autoJob.verifyJob</value>
</property>
</bean> <bean name="FirstJob"
class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>com.newWebSite.util.autoJob.TestJob</value>
</property>
<property name="jobDataAsMap">
<map>
<entry key="asmj" value-ref="autoSendingMailJob" />
</map>
</property>
</bean> <bean id="cronTrigger"
class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="FirstJob" />
</property>
<property name="cronExpression">
<value>0 35 22 * * ?</value>
</property>
</bean> <bean
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="cronTrigger" />
</list>
</property>
</bean></beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="autoSendingMailJob"
class="com.newWebSite.util.autoJob.autoSendingMailJob" /> <bean name="verifyJob"
class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>com.newWebSite.util.autoJob.verifyJob</value>
</property>
</bean> <bean name="FirstJob"
class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>com.newWebSite.util.autoJob.TestJob</value>
</property>
<property name="jobDataAsMap">
<map>
<entry key="asmj" value-ref="autoSendingMailJob" />
</map>
</property>
</bean> <bean id="cronTrigger"
class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="FirstJob" />
</property>
<property name="cronExpression">
<value>0 35 22 * * ?</value>
</property>
</bean> <bean
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="cronTrigger" />
</list>
</property>
</bean></beans>