Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 370173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:59:32+00:00 2026-05-12T13:59:32+00:00

good people. i’m trying to use quartz with spring in a very simple project

  • 0

good people. i’m trying to use quartz with spring in a very simple project managed by maven.So in the module in which the mycron job class is i included a java main class to it just to see the job output some text and new date.
here is my spring config:

<!--Scheduling-->
<!--Job-->
    <bean id="projUpdater" class="org.springframework.scheduling.quartz.JobDetailBean">
        <property name="jobClass" value="com.myproject.utilscheduling.quartz.ProjUpdaterCronImpl" />
    </bean>
<!---End of Jobs-->
<!--Triggers-->
    <bean id="regularUpdateTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail" ref="projUpdater"/>
        <property name="cronExpression" value="30 1 * * * ?"/>
    </bean>
<!--End ofTriggers-->
<!--Scheduler Factory-->
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="triggers">
        <list>
            <ref bean="regularUpdateTrigger"/>
        </list>
    </property>
</bean>
<!--End of Scheduler Factory-->
<!--End of Scheduling-->

and here is the job class

public class ProjUpdaterCronImpl extends QuartzJobBean {

public ProjUpdaterCronImpl() {
}


protected void executeInternal (JobExecutionContext ctx) throws JobExecutionException {
    System.out.println("[JOB] " + new Date() + "hello");
}

}

here is main class

public class NewMain {

/**
 * @param args the command line arguments
 */
 public static void main(String[] args) {
    System.out.println("starting job");
 }

}

so in my understanding the job will be started after 1mn30s and posted on the console.I’m wrong.i faced couple or errors that i solve so i can safely assume that there is no error in in spring configuration file since there is none when building and running.So what did i do wrong or what did i forget to do?

second concern since i’m forcing myself to go the test driven way how will i possibly test a the cron job class?
thanks for reading

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:59:32+00:00Added an answer on May 12, 2026 at 1:59 pm

    Your cron expression

    <property name="cronExpression" value="30 1 * * * ?"/>
    

    actually configures the trigger to fire once every hour at 1 minute 30 seconds after the hour.

    Zoidberg’s suggestion to use MethodInvokingJobDetailFactoryBean allows you to code your cron job as a POJO, making it easy to test.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any good applications that people use with the MongoDB database to make
Good evening guys. I'm currently trying to get started on development of a project
Good people, I have installed djangoratings in my django project and i want to
The good people of OWASP emphasize that you MUST use the escape syntax for
Greetings good people of the internet:) I have a string value 1,5 which after
Good day people, I am working on a project where i load pages into
Very specific question but we have some good Ada people here so I would
Afternoon good people of Stack Overflow. I am trying to do something that I
Good morning people, I am trying to create a custom baking script for cakephp.
Greetings good people - I need some help. I have until now buildt web-pages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.