if(_logger.isInfoEnabled())
_logger.info("made it here 01");
SchedulerFactory schedFact = new StdSchedulerFactory();
if(_logger.isInfoEnabled())
_logger.info("made it here 02");
_sched = schedFact.getScheduler();
这个代码块位于同步块的内部,同步块还检查sched(声明为org.quartz.Scheduler)当前是否正在运行。如果我们进入synchronized块并发现调度程序当前正在运行,我们将关闭它。
代码似乎挂起在StdSchedulerFactor()对象的实际实例化上。”在这里做了01“打印出来,然而,”在这里做了02“从来没有打印出来。
这段代码在我的本地机器和实验室环境中运行良好。当部署到客户机服务器时,它会失败。
几个音符
此代码位于try/catch块中。不会抛出任何错误
部署的代码在几个环境中运行良好,但在一个环境中失败
同样,没有报告错误(我希望在日志中的某个地方可能会发现ClassDefNotFound错误…但是没有)
在本地环境中,catalina.log文件中打印了以下内容。
[2018-11-11 07:23:07,456] [INFO] [QuartzScheduler.java:694] [Scheduler
DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.]
[2018-11-11 07:23:07,457] [INFO] [QuartzScheduler.java:613] [Scheduler
DefaultQuartzScheduler_$_NON_CLUSTERED paused.]
[2018-11-11 07:23:07,457] [INFO] [QuartzScheduler.java:771] [Scheduler
DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.]
[2018-11-11 07:23:07,459] [INFO] [StdSchedulerFactory.java:1184] [Using
default implementation for ThreadExecutor]
[2018-11-11 07:23:07,459] [INFO] [SimpleThreadPool.java:268] [Job execution
threads will use class loader of thread: pool-6-thread-1]
[2018-11-11 07:23:07,462] [INFO] [SchedulerSignalerImpl.java:61]
[Initialized Scheduler Signaller of type: class
org.quartz.core.SchedulerSignalerImpl]
[2018-11-11 07:23:07,462] [INFO] [QuartzScheduler.java:240] [Quartz
Scheduler v.2.2.1 created.]
[2018-11-11 07:23:07,463] [INFO] [RAMJobStore.java:155] [RAMJobStore
initialized.]
[2018-11-11 07:23:07,463] [INFO] [QuartzScheduler.java:305] [Scheduler meta-
data: Quartz Scheduler (v2.2.1) 'DefaultQuartzScheduler' with instanceId
'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support
persistence. and is not clustered.
]
[2018-11-11 07:23:07,463] [INFO] [StdSchedulerFactory.java:1339] [Quartz
scheduler 'DefaultQuartzScheduler' initialized from default resource file in
Quartz package: 'quartz.properties']
[2018-11-11 07:23:07,463] [INFO] [StdSchedulerFactory.java:1343] [Quartz
scheduler version: 2.2.1]
同样,打印输出来自我的本地工作环境。但在客户端环境中,这一点永远不会被打印出来。但也不会打印错误。
如果需要的话,我可以包含更多的整体代码,但是,由于这段代码适用于我尝试过的所有其他环境,我想知道是否有一些环境设置需要我查找?