QuartzInitializerListener的延迟初始化

时间:2015-05-04 10:09:06

标签: java quartz-scheduler

我需要使用java代码创建石英表,然后在不重新启动服务器的情况下初始化QuartzInitializerListener servlet 。有没有可能实现它?

目前,当我启动jboss时,QuartzInitializerListener正在尝试初始化但是表不存在因此会引发某些错误:

[STDOUT] Quartz Scheduler failed to initialize: org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn't clean volatile data: Invalid object name 'QRTZ_TRIGGERS'. [See nested exception: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'QRTZ_TRIGGERS'.]]
13:32:50,279 ERROR [STDERR] org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn't clean volatile data: Invalid object name 'QRTZ_TRIGGERS'. [See nested exception: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'QRTZ_TRIGGERS'.]]
13:32:50,280 ERROR [STDERR]     at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:582)

的web.xml

<context-param>
         <param-name>shutdown-on-unload</param-name>
         <param-value>true</param-value>
     </context-param>
     <context-param>
         <param-name>start-scheduler-on-load</param-name>
         <param-value>true</param-value>
     </context-param>


     <listener>
            <listener-class>
                org.quartz.ee.servlet.QuartzInitializerListener
            </listener-class>
    </listener>

quartz.property

org.quartz.dataSource.arch.jndiURL  = java:/abcDBJndi 
org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPlugin
org.quartz.plugin.jobInitializer.fileNames = jobs.xml
org.quartz.plugin.jobInitializer.overWriteExistingJobs = true
org.quartz.plugin.jobInitializer.failOnFileNotFound = true
org.quartz.plugin.jobInitializer.scanInterval = 100
org.quartz.plugin.jobInitializer.wrapInUserTransaction = false

我意识到QuartzInitializerListener无法处理请求但是如果有任何方法可以使用java代码和最初的工作来设置jndiURL ..请帮助!!

0 个答案:

没有答案