Quartz StdSchedulerFactory() instantiation hangs in Java











up vote
1
down vote

favorite












I've searched through all of the related Quartz Scheduler questions here and haven't found anyone else having an issue like the one I'm seeing. This question is not about issues with schedules not running correctly or jobs not being triggered which is what I've mostly found. I seem to be entering into a hung state when I simply try to instantiate a StdSchedulerFactory object.



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();


This block of code is inside of a synchronized block that also checks to see if _sched (which is declared as org.quartz.Scheduler) is currently running. If we enter the synchronized block and find that a Scheduler is currently running, we shut it down.



The code seems to be hanging on the actual instantiation of the StdSchedulerFactor() object. "made it here 01" prints out, however, "made it here 02" never prints out.



This code works fine on my local machine and on a lab environment. When deployed to a client server, it fails.



Couple of notes




  • This code is inside a try/catch block. No error is ever thrown

  • I'm using quartz 2.2.1 (we have to stay on jdk 1.6)

  • The deployed code is working fine on several environments, just failing on one

  • Again, no errors reported (I was expecting to maybe find a ClassDefNotFound error somewhere in my logs...but nothing)


On my local environment I get the following printed out in my catalina.log file.



[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]


Again, that printout is from my local environment that is working. On the client environment though, that never gets printed. No errors are ever printed though either.



I can include more of the overall code if needed, however, since this code works on every other environment I've tried it on, I'm wondering if there is some environment setting that I may need to look for?










share|improve this question






















  • Follow up question to my question above. Is it possible that it might be better to use Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler() to get a Scheduler object rather than constantly instantiating a new StdSchedulerFactory() and then retrieving a scheduler from that new object?
    – Jason Schade
    Nov 12 at 20:38















up vote
1
down vote

favorite












I've searched through all of the related Quartz Scheduler questions here and haven't found anyone else having an issue like the one I'm seeing. This question is not about issues with schedules not running correctly or jobs not being triggered which is what I've mostly found. I seem to be entering into a hung state when I simply try to instantiate a StdSchedulerFactory object.



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();


This block of code is inside of a synchronized block that also checks to see if _sched (which is declared as org.quartz.Scheduler) is currently running. If we enter the synchronized block and find that a Scheduler is currently running, we shut it down.



The code seems to be hanging on the actual instantiation of the StdSchedulerFactor() object. "made it here 01" prints out, however, "made it here 02" never prints out.



This code works fine on my local machine and on a lab environment. When deployed to a client server, it fails.



Couple of notes




  • This code is inside a try/catch block. No error is ever thrown

  • I'm using quartz 2.2.1 (we have to stay on jdk 1.6)

  • The deployed code is working fine on several environments, just failing on one

  • Again, no errors reported (I was expecting to maybe find a ClassDefNotFound error somewhere in my logs...but nothing)


On my local environment I get the following printed out in my catalina.log file.



[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]


Again, that printout is from my local environment that is working. On the client environment though, that never gets printed. No errors are ever printed though either.



I can include more of the overall code if needed, however, since this code works on every other environment I've tried it on, I'm wondering if there is some environment setting that I may need to look for?










share|improve this question






















  • Follow up question to my question above. Is it possible that it might be better to use Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler() to get a Scheduler object rather than constantly instantiating a new StdSchedulerFactory() and then retrieving a scheduler from that new object?
    – Jason Schade
    Nov 12 at 20:38













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I've searched through all of the related Quartz Scheduler questions here and haven't found anyone else having an issue like the one I'm seeing. This question is not about issues with schedules not running correctly or jobs not being triggered which is what I've mostly found. I seem to be entering into a hung state when I simply try to instantiate a StdSchedulerFactory object.



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();


This block of code is inside of a synchronized block that also checks to see if _sched (which is declared as org.quartz.Scheduler) is currently running. If we enter the synchronized block and find that a Scheduler is currently running, we shut it down.



The code seems to be hanging on the actual instantiation of the StdSchedulerFactor() object. "made it here 01" prints out, however, "made it here 02" never prints out.



This code works fine on my local machine and on a lab environment. When deployed to a client server, it fails.



Couple of notes




  • This code is inside a try/catch block. No error is ever thrown

  • I'm using quartz 2.2.1 (we have to stay on jdk 1.6)

  • The deployed code is working fine on several environments, just failing on one

  • Again, no errors reported (I was expecting to maybe find a ClassDefNotFound error somewhere in my logs...but nothing)


On my local environment I get the following printed out in my catalina.log file.



[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]


Again, that printout is from my local environment that is working. On the client environment though, that never gets printed. No errors are ever printed though either.



I can include more of the overall code if needed, however, since this code works on every other environment I've tried it on, I'm wondering if there is some environment setting that I may need to look for?










share|improve this question













I've searched through all of the related Quartz Scheduler questions here and haven't found anyone else having an issue like the one I'm seeing. This question is not about issues with schedules not running correctly or jobs not being triggered which is what I've mostly found. I seem to be entering into a hung state when I simply try to instantiate a StdSchedulerFactory object.



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();


This block of code is inside of a synchronized block that also checks to see if _sched (which is declared as org.quartz.Scheduler) is currently running. If we enter the synchronized block and find that a Scheduler is currently running, we shut it down.



The code seems to be hanging on the actual instantiation of the StdSchedulerFactor() object. "made it here 01" prints out, however, "made it here 02" never prints out.



This code works fine on my local machine and on a lab environment. When deployed to a client server, it fails.



Couple of notes




  • This code is inside a try/catch block. No error is ever thrown

  • I'm using quartz 2.2.1 (we have to stay on jdk 1.6)

  • The deployed code is working fine on several environments, just failing on one

  • Again, no errors reported (I was expecting to maybe find a ClassDefNotFound error somewhere in my logs...but nothing)


On my local environment I get the following printed out in my catalina.log file.



[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]


Again, that printout is from my local environment that is working. On the client environment though, that never gets printed. No errors are ever printed though either.



I can include more of the overall code if needed, however, since this code works on every other environment I've tried it on, I'm wondering if there is some environment setting that I may need to look for?







java quartz-scheduler jdk1.6






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 at 20:00









Jason Schade

62




62












  • Follow up question to my question above. Is it possible that it might be better to use Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler() to get a Scheduler object rather than constantly instantiating a new StdSchedulerFactory() and then retrieving a scheduler from that new object?
    – Jason Schade
    Nov 12 at 20:38


















  • Follow up question to my question above. Is it possible that it might be better to use Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler() to get a Scheduler object rather than constantly instantiating a new StdSchedulerFactory() and then retrieving a scheduler from that new object?
    – Jason Schade
    Nov 12 at 20:38
















Follow up question to my question above. Is it possible that it might be better to use Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler() to get a Scheduler object rather than constantly instantiating a new StdSchedulerFactory() and then retrieving a scheduler from that new object?
– Jason Schade
Nov 12 at 20:38




Follow up question to my question above. Is it possible that it might be better to use Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler() to get a Scheduler object rather than constantly instantiating a new StdSchedulerFactory() and then retrieving a scheduler from that new object?
– Jason Schade
Nov 12 at 20:38

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53269266%2fquartz-stdschedulerfactory-instantiation-hangs-in-java%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53269266%2fquartz-stdschedulerfactory-instantiation-hangs-in-java%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents