问题描述
我正在将我的应用程序从 JBoss 5 迁移到 Wildfly 21.0.1.Final。我在 Wildfly 上部署了一个包含 war 和 jar 模块的 ear 文件。在服务器启动期间,我看到以下错误
02:56:03,956 INFO [com.xis.framework.batch.service.scheduler.QuartzScheluder] (ServerService Thread Pool -- 114) START :: com.xis.framework.batch.service.scheduler.QuartzScheluder.getSchduler()
02:56:03,967 ERROR [com.xis.framework.batch.service.scheduler.QuartzScheluder] (ServerService Thread Pool -- 114) **Error occured while getting the schduler object: org.quartz.SchedulerConfigException: Unable to instantiate class load helper class: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper [See nested exception: java.lang.ClassCastException: org.quartz.simpl.CascadingClassLoadHelper cannot be cast to org.quartz.spi.ClassLoadHelper**
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:538)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1094)
at com.xiss.framework.batch.service.scheduler.QuartzScheluder.getSchduler(QuartzScheluder.java:68)
at com.xis.framework.batch.service.scheduler.QuartzScheluder.processJobs(QuartzScheluder.java:40)
at com.xis.framework.batch.service.scheduler.QuartzInitializerListener.contextInitialized(QuartzInitializerListener.java:99)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:219)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
QuartzScheluder.java
if (jobDetails != null && jobDetails.size() != 0) {
Scheduler scheduler = getSchduler(); --->Error at this line
for (QuartzJobDetail jobDet : jobDetails) {
processSchduler(jobDet,scheduler);
}
private static Scheduler getSchduler() {
if(logger.isInfoEnabled()){
logger.info(" START :: "+ QuartzScheluder.class.getName() +".getSchduler()");
}
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler scheduler = null;
try {
scheduler = sf.getScheduler();
scheduler.start();
} catch (SchedulerException e) {
logger.error("Error occured while getting the schduler object",e);
}
if(logger.isInfoEnabled()){
logger.info(" END :: "+ QuartzScheluder.class.getName() +".getSchduler()");
}
return scheduler;
}
使用位于 org/quartz 包中的quartz.properties”文件(作为资源)
org.quartz.scheduler.instanceName = DefaultQuartzScheduler
org.quartz.scheduler.rmi.export = false
org.quartz.scheduler.rmi.proxy = false
org.quartz.scheduler.wrapJobExecutionInUserTransaction = false
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
我的耳朵 pom.xml 有以下依赖
<dependency>
<groupId>opensymphony</groupId>
<artifactId>quartz</artifactId>
<version>1.6.3</version>
</dependency>
还有其他人遇到过这个问题吗?可以做些什么来解决这个问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)