File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Spring Quartz application in JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Quartz application in JBoss" Watch "Spring Quartz application in JBoss" New topic

Spring Quartz application in JBoss

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208

I have a Quartz application that is deployed to a JBoss server as a high standalone application,

The Quartz application is deployed to JBoss as a Message Driven EJB through declared in ejb-jar.xml,

But I would like to remove the EJB concept within the application and use Spring Quartz,

But any ideas or information on how to deploy a Spring Quartz application to JBoss as a high standalone application?

Thanks in Advance,

William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Spring has Quartz support.

I don't have my regular Eclipse running now, but later I can share an example.

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208
Thanks WP, any and all advice would be great,


Ken Rimple
Ranch Hand

Joined: Jul 20, 2010
Posts: 63

Spring now has a scheduling annotation feature. You can either use Quartz or use Spring Scheduling.

You'd have to set up a Spring context - look into the ContextLoaderListener (google it, for an example) - you mount it in your web.xml, and it will load a Spring configuration that you point to.

For example, you could use this setup:

/ (web root)

-- spring
--- applicationContext.xml

Then use the path:
/WEB-INF/spring/applicationContext.xml when configuring the ContextLoaderListener parameters.

Ok, once that is done (again, plenty on setting up this in web.xml on Google) you can set up beans to fire via Quartz or by Spring's scheduler options. See this page for details:

See 25.6 for all the details you need to use quartz. You'll need to import the Quartz jars, but beyond that, this may really do it for you:

25.6.3: here are two types of quartz jobs you can schedule - direct from the documentation above.

SO access to simple repeating jobs, CRON syntax support, using Quartz jobs.

It really is a nice feature of the framework.

You should also check out @Scheduled and @Async - you can annotate a method async and have it run outside of your thread. Pretty nifty for certain 'fire and forget' operations where normally you needed to set up JMS and a queue in the past.

Ken Rimple
Co-author, Manning Spring Roo in Action
I teach for Chariot Solutions (Spring, Maven, Hibernate, other courses). Schedule here
I agree. Here's the link:
subject: Spring Quartz application in JBoss
It's not a secret anymore!