论坛首页 Java企业应用论坛

Quartz任务监控管理 (1)

浏览 73632 次
该帖已经被评为精华帖
作者 正文
   发表时间:2009-09-14  
我已经发过去了,帮忙看看吧。谢啦
0 请登录后投票
   发表时间:2009-09-14   最后修改:2009-09-14
yanyu510 写道
不知道什么原因,现在可能添加tigger了,然后HibernateTemplate也能得到值了,就是执行backupDateabase()这个方法的时候还抛异常:
2009-9-14 11:56:07 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\MyEclipse 5.5 GA\bin;D:\Program Files\Apache Software Foundation\Tomcat 5.5\bin
2009-9-14 11:56:07 org.apache.coyote.http11.Http11BaseProtocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2009-9-14 11:56:07 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1172 ms
2009-9-14 11:56:08 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2009-9-14 11:56:08 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/5.5.20
2009-9-14 11:56:08 org.apache.catalina.core.StandardHost start
信息: XML validation disabled
2009-9-14 11:56:21 org.apache.coyote.http11.Http11BaseProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2009-9-14 11:56:22 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2009-9-14 11:56:22 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/94  config=null
2009-9-14 11:56:22 org.apache.catalina.storeconfig.StoreLoader load
信息: Find registry server-registry.xml at classpath resource
2009-9-14 11:56:22 org.apache.catalina.startup.Catalina start
信息: Server startup in 14406 ms
com.dao.MyHibernateTemplate@1f18cbe
[2009-09-14 11:56:58]ERROR org.quartz.core.JobRunShell(line:211) -Job DEFAULT.jobDetail threw an unhandled Exception: 
java.lang.IllegalArgumentException: No SessionFactory specified
	at org.springframework.util.Assert.notNull(Assert.java:112)
	at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:281)
	at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:233)
	at org.springframework.orm.hibernate3.HibernateTemplate.getSession(HibernateTemplate.java:425)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:361)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:33)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
[2009-09-14 11:56:58]ERROR org.quartz.core.ErrorLogger(line:2185) -Job (DEFAULT.jobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.IllegalArgumentException: No SessionFactory specified]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.lang.IllegalArgumentException: No SessionFactory specified
	at org.springframework.util.Assert.notNull(Assert.java:112)
	at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:281)
	at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:233)
	at org.springframework.orm.hibernate3.HibernateTemplate.getSession(HibernateTemplate.java:425)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:361)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:33)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	... 1 more
com.dao.MyHibernateTemplate@5364
[2009-09-14 11:57:00]ERROR org.quartz.core.JobRunShell(line:211) -Job DEFAULT.jobDetail threw an unhandled Exception: 
java.lang.IllegalArgumentException: No SessionFactory specified
	at org.springframework.util.Assert.notNull(Assert.java:112)
	at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:281)
	at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:233)
	at org.springframework.orm.hibernate3.HibernateTemplate.getSession(HibernateTemplate.java:425)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:361)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:33)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
[2009-09-14 11:57:00]ERROR org.quartz.core.ErrorLogger(line:2185) -Job (DEFAULT.jobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.IllegalArgumentException: No SessionFactory specified]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.lang.IllegalArgumentException: No SessionFactory specified
	at org.springframework.util.Assert.notNull(Assert.java:112)
	at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:281)
	at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:233)
	at org.springframework.orm.hibernate3.HibernateTemplate.getSession(HibernateTemplate.java:425)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:361)
	at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:33)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	... 1 more



BakcupDao 这样写

引用
import java.io.Serializable; 
  
import org.hibernate.SessionFactory; 
import org.slf4j.Logger; 
import org.slf4j.LoggerFactory; 
import org.springframework.beans.factory.annotation.Autowired; 
import org.springframework.stereotype.Repository; 
 
import com.sundoctor.example.service.SimpleService; 
 
@Repository("bakcupDao") 
public class BakcupDao implements Serializable { 
 
   /**
      * 
      */ 
     private static final long serialVersionUID = 1L;
    private SessionFactory sessionFactory;
  
     @Autowired 
     public void setSessionFactory(SessionFactory sessionFactory) { 
        this.sessionFactory = sessionFactory;
     } 
  
  
     public boolean backupDateabase(String dbname, String bfname) {

                 HibernateTemplate  hibernateTemplate = new HibernateTemplate(sessionFactory);
         final String dbName = dbname; 
         final String bfname1 = bfname; 
         return (Boolean)hibernateTemplate.execute(new HibernateCallback() { 
             public Object doInHibernate(Session session) { 
                 boolean flag = true; 
                 PreparedStatement pstmt = null; 
  
                 try { 
                     pstmt = session.connection().prepareStatement("{call p_Backup_Or_Restore(?,?,?)}"); 
                     pstmt.setString(1, bfname1); 
                     pstmt.setString(2, dbName); 
                     pstmt.setInt(3, 1); 
                     pstmt.execute(); 
                     System.out.println("数据库已备份"); 
                 } catch (Exception e) { 
                     flag = false; 
                     e.printStackTrace(); 
                 } 
                 return flag; 
             } 
         }); 
     } 


就可以了,注意红色地方,不再需要MyHibernateTemplate这个类了。
0 请登录后投票
   发表时间:2009-09-14   最后修改:2009-09-14
[2009-09-14 13:15:58]ERROR org.quartz.core.JobRunShell(line:211) -Job DEFAULT.jobDetail threw an unhandled Exception: 
java.lang.IllegalArgumentException: Property 'sessionFactory' is required
	at org.springframework.orm.hibernate3.HibernateAccessor.afterPropertiesSet(HibernateAccessor.java:314)
	at org.springframework.orm.hibernate3.HibernateTemplate.<init>(HibernateTemplate.java:146)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:31)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
[2009-09-14 13:15:58]ERROR org.quartz.core.JobRunShell(line:211) -Job DEFAULT.jobDetail threw an unhandled Exception: 
java.lang.IllegalArgumentException: Property 'sessionFactory' is required
	at org.springframework.orm.hibernate3.HibernateAccessor.afterPropertiesSet(HibernateAccessor.java:314)
	at org.springframework.orm.hibernate3.HibernateTemplate.<init>(HibernateTemplate.java:146)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:31)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
[2009-09-14 13:15:58]ERROR org.quartz.core.ErrorLogger(line:2185) -Job (DEFAULT.jobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.IllegalArgumentException: Property 'sessionFactory' is required]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.lang.IllegalArgumentException: Property 'sessionFactory' is required
	at org.springframework.orm.hibernate3.HibernateAccessor.afterPropertiesSet(HibernateAccessor.java:314)
	at org.springframework.orm.hibernate3.HibernateTemplate.<init>(HibernateTemplate.java:146)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:31)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	... 1 more
[2009-09-14 13:15:58]ERROR org.quartz.core.ErrorLogger(line:2185) -Job (DEFAULT.jobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.IllegalArgumentException: Property 'sessionFactory' is required]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.lang.IllegalArgumentException: Property 'sessionFactory' is required
	at org.springframework.orm.hibernate3.HibernateAccessor.afterPropertiesSet(HibernateAccessor.java:314)
	at org.springframework.orm.hibernate3.HibernateTemplate.<init>(HibernateTemplate.java:146)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:31)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	... 1 more
[2009-09-14 13:16:00]ERROR org.quartz.core.JobRunShell(line:211) -Job DEFAULT.jobDetail threw an unhandled Exception: 
java.lang.IllegalArgumentException: Property 'sessionFactory' is required
	at org.springframework.orm.hibernate3.HibernateAccessor.afterPropertiesSet(HibernateAccessor.java:314)
	at org.springframework.orm.hibernate3.HibernateTemplate.<init>(HibernateTemplate.java:146)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:31)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
[2009-09-14 13:16:00]ERROR org.quartz.core.ErrorLogger(line:2185) -Job (DEFAULT.jobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.IllegalArgumentException: Property 'sessionFactory' is required]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.lang.IllegalArgumentException: Property 'sessionFactory' is required
	at org.springframework.orm.hibernate3.HibernateAccessor.afterPropertiesSet(HibernateAccessor.java:314)
	at org.springframework.orm.hibernate3.HibernateTemplate.<init>(HibernateTemplate.java:146)
	at com.dao.BackupDao.backupDateabase(BackupDao.java:31)
	at com.sundoctor.example.service.SimpleService.testMethod(SimpleService.java:26)
	at com.sundoctor.example.service.MyQuartzJobBean.executeInternal(MyQuartzJobBean.java:22)
	at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	... 1 more


还有错。sessionFactory是null
package com.dao;

import java.io.Serializable;
import java.sql.PreparedStatement;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.HibernateTemplate;

public class BackupDao implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8933456923281729867L;

	private SessionFactory sessionFactory;

	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	public boolean backupDateabase(String dbname, String bfname) {
		final String dbName = dbname;
		final String bfname1 = bfname;
		System.out.println(sessionFactory);
		HibernateTemplate hibernateTemplate = new HibernateTemplate(
				sessionFactory);
		return (Boolean) hibernateTemplate.execute(new HibernateCallback() {
			public Object doInHibernate(Session session) {
				boolean flag = true;
				PreparedStatement pstmt = null;

				try {
					pstmt = session.connection().prepareStatement(
							"{call p_Backup_Or_Restore(?,?,?)}");
					pstmt.setString(1, bfname1);
					pstmt.setString(2, dbName);
					pstmt.setInt(3, 1);
					pstmt.execute();
					System.out.println("数据库已备份");
				} catch (Exception e) {
					flag = false;
					e.printStackTrace();
				}
				return flag;
			}
		});
	}

}

0 请登录后投票
   发表时间:2009-09-14   最后修改:2009-09-14
引用

public boolean backupDateabase(String dbname, String bfname) { 
    final String dbName = dbname; 
    final String bfname1 = bfname; 
   System.out.println(sessionFactory);

如果你在红色打印出sessionFactory为null,我觉得你什么地方配置有问题,你再仔细查查。

你的代码我还没有收到,这是我测试过的代码,没有问题,你下载看看
0 请登录后投票
   发表时间:2009-09-14   最后修改:2009-09-14
yanyu510 写道
我把代码发过去,你给我看看吧。谢啦!


代码己经给你修改了,没有问题了

主要修改地方:

去掉lib下面无用的jar包

给SchedulerServiceImpl增加了一个方法

public void init() throws SchedulerException{
logger.info("init start....................");
scheduler.addJob(jobDetail, true);
logger.info("init end.......................");
}


修改配置文件

<bean name="quartzScheduler"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="applicationContextSchedulerContextKey"
value="applicationContextKey" />
<property name="configLocation"
value="classpath:quartz.properties" />
<!-- 延时启动,这个很重要,必须要有足够长的时间让你的应用先启动完成后再让 Scheduler启动,
这里设置60秒,如果你的应用启动时间较长,要相应增加startupDelay的时间-->
<property name="startupDelay" value="60"/>
</bean>

<bean id="schedulerService"
class="com.sundoctor.quartz.service.SchedulerServiceImpl" init-method="init">
<property name="scheduler">
<ref bean="quartzScheduler" />
</property>
<property name="jobDetail">
<ref local="jobDetail" />
</property>
<property name="quartzDao">
<ref bean="quartzDao" />
</property>
</bean>

注意红色地方。
0 请登录后投票
   发表时间:2009-09-15  
补充:增加hibernate

经过这段时间,有人在本例子上增加hibernate后遇到好些问题,比如要在SimpleService注入一个hibernate Dao,我们一般习惯让DAO继承自HibernateDaoSupport类,这样在Dao里取到的HibernateTemplate总为null。因为
SimpleService和它的属性、还有属性的属性等必须实现序列化接口,而HibernateTemplate是没实现序列化接口,所以取到的HibernateTemplate总为null。但是SessionFactory实现了序列化接口,因此我们的hibernaate Dao不能继承自HibernateDaoSupport,只实现Serializable接口即可,在DAO注入SessionFactory,通过SessionFactory获取HibernateTemplate,如:
package com.sundoctor.quartz.dao;

import java.io.Serializable;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

import com.sundoctor.example.model.Customer;
import com.sundoctor.example.service.SimpleService;

@Repository("testHibernateDao")
public class TestHibernateDaoImpl implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static final Logger logger = LoggerFactory.getLogger(SimpleService.class);	
	private SessionFactory sessionFactory;

	@Autowired
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;		
	}

	public Customer backupDateabase() {

		HibernateTemplate  hibernateTemplate = new HibernateTemplate(sessionFactory);
		return (Customer) hibernateTemplate.execute(new HibernateCallback() {
			public Object doInHibernate(Session session) {				
				logger.info("Session2=={}", session);
				Customer customer = (Customer)session.createQuery("from Customer where id = 1").uniqueResult();
				logger.info("Customer2={}", customer);						
				return customer;
			}
		});
	}

	public void test() {
		logger.info("getSessionFactory=={}",this.sessionFactory );		
		HibernateTemplate  hibernateTemplate = new HibernateTemplate(sessionFactory);
		Customer customer = (Customer)hibernateTemplate.get(Customer.class, 1);
		logger.info("Customer={}", customer);				
	}

}



@Service("simpleService")
public class SimpleService implements Serializable {

	private static final long serialVersionUID = 122323233244334343L;
	private static final Logger logger = LoggerFactory.getLogger(SimpleService.class);

	private TestHibernateDaoImpl testHibernateDao;	
	@Autowired
	public void setTestHibernateDao(TestHibernateDaoImpl testHibernateDao) {
		this.testHibernateDao = testHibernateDao;
	}
。。。


其次给SchedulerServiceImpl增加一个初如化方法
	@PostConstruct
	public void init() throws SchedulerException{
		logger.info("init start....................");
		scheduler.addJob(jobDetail, true);
		logger.info("init end.......................");
	}

让应用在启动时进行初始化,主要是让应用每次启动时更新qrtz_cron_triggers表的job_class_name字段,否则应用启动时,如果库里己经存在tirgger,从数据库加载tirgger时会报
引用

ERROR org.springframework.scheduling.quartz.LocalDataSourceJobStore(line:2884) -Error retrieving job, setting trigger state to ERROR.
org.quartz.JobPersistenceException: Couldn't retrieve job because the BLOB couldn't be deserialized: Could not find a SessionFactory named: null [See nested exception: java.io.InvalidObjectException: Could not find a SessionFactory named: null]


异常。

最后修改applicationContext-quartz.xml
引用

    <bean name="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" >
        <property name="dataSource" ref ="dataSource" />      
        <property name="applicationContextSchedulerContextKey" value="applicationContextKey"/>
        <property name="configLocation" value="classpath:quartz.properties"/>
<property name="startupDelay" value="60"/>
    </bean>

增加红色内容,这个很重要,让quartzScheduler延时启动,必须在应用启动完后再启动,这里设置60秒,可以根据自己应用启动时间长短修改。

附件是在原来基础代码上增加了hibernate
0 请登录后投票
   发表时间:2009-09-15  
还是不错的,先试试了
0 请登录后投票
   发表时间:2009-09-16   最后修改:2009-09-16
连接postgre8 ,添加simple trigger时出现如下异常
Caused by: org.postgresql.util.PSQLException: Bad value for type int : \254\355\000\005sr\000\025org.quartz.JobDataMap\237\260\203\350\277\251\260\313\002\000\000xr\000&org.quartz.utils.StringKeyDirtyFlagMap\202\010\350\303\373\305](\002\000\001Z\000\023allowsTransientDataxr\000\035org.quartz.utils.DirtyFlagMap\023\346.\255(v\012\316\002\000\002Z\000\005dirtyL\000\003mapt\000\017Ljava/util/Map;xp\001sr\000\021java.util.HashMap\005\007\332\301\303\026`\321\003\000\002F\000\012loadFactorI\000\011thresholdxp?@\000\000\000\000\000\014w\010\000\000\000\020\000\000\000\001t\000\015simpleServicesr\000+com.sundoctor.example.service.SimpleService\001\262\224U!NI\007\002\000\001L\000\020testHibernateDaot\000/Lcom/sundoctor/quartz/dao/TestHibernateDaoImpl;xpsr\000-com.sundoctor.quartz.dao.TestHibernateDaoImpl\000\000\000\000\000\000\000\001\002\000\001L\000\016sessionFactoryt\000\036Lorg/hibernate/SessionFactory;xpsr\000%org.hibernate.impl.SessionFactoryImpl\222\002d\274Y\231\010\314\003\000\003L\000\004namet\000\022Ljava/lang/String;L\000\016queryPlanCachet\000+Lorg/hibernate/engine/query/QueryPlanCache;L\000\004uuidq\000~\000\017xppsr\000)org.hibernate.engine.query.QueryPlanCacheM?/\267I\305\3369\002\000\003L\000\007factoryt\0000Lorg/hibernate/engine/SessionFactoryImplementor;L\000\011planCachet\000&Lorg/hibernate/util/SoftLimitMRUCache;L\000\025sqlParamMetadataCachet\000#Lorg/hibernate/util/SimpleMRUCache;xpq\000~\000\021sr\000$org.hibernate.util.SoftLimitMRUCache\377\273M\262D\255\023\367\002\000\001I\000\024strongReferenceCountxp\000\000\000\200sr\000!org.hibernate.util.SimpleMRUCache\347sl\230\362\012\352\344\002\000\001I\000\024strongReferenceCountxp\000\000\000\200t\000 402883b823c2318e0123c23192940000xx\000
有些不解。
0 请登录后投票
   发表时间:2009-09-16  
上面的问题找到答案了,修改quartz.properties:
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
0 请登录后投票
   发表时间:2009-09-16   最后修改:2009-09-16
请教lz为何在
scheduler.scheduleJob(cronTrigger);
后要调用
scheduler.rescheduleJob(cronTrigger.getName(),cronTrigger.getGroup(), cronTrigger);
这里不是很明白
另外jobGroup一般会在何种场合区分使用
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics