<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "JVM ends immediately with running scheduler while expected to wait for its shutdown"]]></title>
		<link>http://forums.terracotta.org/forums/posts/list/17.page</link>
		<description><![CDATA[Latest messages posted in the topic "JVM ends immediately with running scheduler while expected to wait for its shutdown"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>JVM ends immediately with running scheduler while expected to wait for its shutdown</title>
				<description><![CDATA[ Hi,

I have read in the <a href="http://www.quartz-scheduler.org/documentation/quartz-2.x/quick-start" target="_new" rel="nofollow">documentation</a> that:
<blockquote>Once you obtain a scheduler using StdSchedulerFactory.getDefaultScheduler(), your application will not terminate until you call scheduler.shutdown(), because there will be active threads.&nbsp;
		</blockquote>

I have found a blog entry about <a href="http://nurkiewicz.blogspot.com/2012/04/quartz-scheduler-plugins-hidden.html" target="_new" rel="nofollow">ShutdownHookPlugin</a> and wanted to write some (self) integration test to prove the new configuration works.

The strange thing is that it seems in the default configuration (no custom quartz.properties) JVM is shutdown anyway. With following code I would expect to have a timeout, but it finishes nicely:

<span class="genmed"><b>Code:</b></span><br>
		<div>
		<pre bbCodeId="pre-code" style="overflow: auto; width: 95%; max-height: 350px; height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">@Test&#40;timeout = 500L&#41;
public void runningQuartzSchedulerShouldNotBlockJvmShutdown&#40;&#41; throws SchedulerException {
    Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler&#40;&#41;;
    scheduler.start&#40;&#41;;
    //should stop test immediately
}</pre>
		</div>

Do you think it could be an "issue" with JUnit runner which ignores/kills other threads? How can I test it?

Regards
Marcin
]]></description>
				<guid isPermaLink="true">http://forums.terracotta.org/forums/posts/list/6902.page#34555</guid>
				<link>http://forums.terracotta.org/forums/posts/list/6902.page#34555</link>
				<pubDate><![CDATA[Wed, 11 Apr 2012 05:16:17]]> GMT</pubDate>
				<author><![CDATA[ szpak]]></author>
			</item>
			<item>
				<title>Re:JVM ends immediately with running scheduler while expected to wait for its shutdown</title>
				<description><![CDATA[ Do you think it is just an outdated text in a documentation and in a current version there is no issue with hanging active threads?
]]></description>
				<guid isPermaLink="true">http://forums.terracotta.org/forums/posts/list/6902.page#34697</guid>
				<link>http://forums.terracotta.org/forums/posts/list/6902.page#34697</link>
				<pubDate><![CDATA[Tue, 17 Apr 2012 14:49:11]]> GMT</pubDate>
				<author><![CDATA[ szpak]]></author>
			</item>
			<item>
				<title>Re:JVM ends immediately with running scheduler while expected to wait for its shutdown</title>
				<description><![CDATA[ Maybe you'll need to add some trigger and jobs to see those extra threads? and allows at least one job triggered to see them in action (adding some sleep())
]]></description>
				<guid isPermaLink="true">http://forums.terracotta.org/forums/posts/list/6902.page#34698</guid>
				<link>http://forums.terracotta.org/forums/posts/list/6902.page#34698</link>
				<pubDate><![CDATA[Tue, 17 Apr 2012 15:06:58]]> GMT</pubDate>
				<author><![CDATA[ hhuynh]]></author>
			</item>
			<item>
				<title>Re:JVM ends immediately with running scheduler while expected to wait for its shutdown</title>
				<description><![CDATA[ No, I think the test framework must be doing something to kill it.

Once you call start() there are definitely threads running.  And unless you've set the quartz config properties that cause them to be daemon threads, they should cause the JVM to stay up until they are terminated.]]></description>
				<guid isPermaLink="true">http://forums.terracotta.org/forums/posts/list/6902.page#34711</guid>
				<link>http://forums.terracotta.org/forums/posts/list/6902.page#34711</link>
				<pubDate><![CDATA[Wed, 18 Apr 2012 07:56:03]]> GMT</pubDate>
				<author><![CDATA[ jhouse]]></author>
			</item>
	</channel>
</rss>