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 6585373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:39:20+00:00 2026-05-25T16:39:20+00:00

I am following this link: http://www.mkyong.com/spring/spring-quartz-scheduler-example/ Everything is working fine. The tutorial shows 3

  • 0

I am following this link:
http://www.mkyong.com/spring/spring-quartz-scheduler-example/

Everything is working fine. The tutorial shows 3 classes and pom file.

I want to make it work with 2 classes.

However I am having issues.

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Loader
{
    public static void main( String[] args ) throws Exception
    {
        new ClassPathXmlApplicationContext("Spring-Quartz.xml");
    }
}

This is the second class

public class Runner extends QuartzJobBean
{
    Runner rRun = new Runner();
    public void printMe() {
        System.out.println(" Quartz Running! ~");
    }

    protected void executeInternal(JobExecutionContext context) 
        throws JobExecutionException
    {
        rRun.printMe();
    }
}

This is the pom bean config file:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">


   <bean name="loader"
    class="org.springframework.scheduling.quartz.JobDetailBean">

        <property name="jobClass" value="Loader" />

        <property name="jobDataAsMap">
            <map>
                <entry key="rRun" value-ref="rRun" />
            </map>
        </property>

    </bean>

    <!--
    <bean id="loader" 
      class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">

        <property name="targetObject" ref="rRun" />
        <property name="targetMethod" value="printMe" />

    </bean>
    -->


<bean id="myPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="location" value="application.properties"/>
  <property name="placeholderPrefix" value="${props:"/>
</bean>

    <!-- Simple Trigger -->
    <bean id="simpleTrigger"
        class="org.springframework.scheduling.quartz.SimpleTriggerBean">

        <property name="jobDetail" ref="loader" />
        <property name="repeatInterval" value="${props:repeatInterval}" />
        <property name="startDelay" value="${props:startDelay}" />

    </bean>

    <!-- Cron Trigger -->
    <bean id="cronTrigger"
        class="org.springframework.scheduling.quartz.CronTriggerBean">

        <property name="jobDetail" ref="runner" />
        <property name="cronExpression" value="${props:cronExpression}" />

    </bean>

    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="jobDetails">
            <list>
            <ref bean="runner" />
            </list>
        </property>

        <property name="triggers">
            <list>
            <ref bean="simpleTrigger" />
            </list>
        </property>

    </bean>

</beans>

Where did I go wrong?

EDIT:

My issues are:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'runner' defined in class path resource [Spring-Quartz.xml]: Cannot resolve reference to bean 'rRun' while setting bean property 'jobDataAsMap' with key [TypedStringValue: value [rRun], target type [null]]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'rRun' is defined
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:378)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:161)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at Loader.main(Loader.java:9)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'rRun' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    ... 17 more
  • 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-25T16:39:20+00:00Added an answer on May 25, 2026 at 4:39 pm

    The exception is in regard to your loader bean. It cannot be found in your bean factory or application context:

    <bean name="loader"
        class="org.springframework.scheduling.quartz.JobDetailBean">
    
        <property name="jobClass" value="Loader" />
    
        <property name="jobDataAsMap">
            <map>
                <entry key="rRun" value-ref="rRun" />
            </map>
        </property>
    
    </bean>
    

    The jobDataAsMap property has an entry that is attempting to reference another bean named rRun, which doesn’t exist in your bean configuration. You probably mean to be adding your class Runner into your bean configuration, like so:

    <bean id="rRun" class="package.of.your.class.Runner" />
    

    This will allow the loader bean to find your class in its application context.

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

Sidebar

Related Questions

following this link http://www.codeproject.com/KB/cs/MDITabBrowsing.aspx I made MDI and things are working well. But I
I'm following a tutorial on this link http://www.codeproject.com/KB/aspnet/ASPNETService.aspx Now I'm stuck at these codes
I'm following this http://www.codeproject.com/Articles/10020/Using-managed-code-in-an-unmanaged-application The example consist of 3 binaries: C# code C++/CLI code
I am following this tutorial http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-5-magento-models-and-orm-basics . As per this tutorial,when i pass a
I am trying to make a combobox in ios following this link http://www.codeproject.com/KB/iPhone/iphonecombobox.aspx .
I have tried to do this refering to following link. http://skypher.com/index.php/2008/07/28/function-list-for-php/ But no success.
The following link outputs a different image every time you visit it: http://www.biglickmedia.com/art/random/index.php From
I'm trying out the example Hello World from this link here: http://www.mulesoft.org/documentation/display/MULE2INTRO/Quick+Start I have
While I am watching the demo with the following link http://www.jetbrains.com/resharper/demos/presentation/overview/refactorings/Refactor_this_demo.htm I saw this
I recently ran the database repair tool as per this link: http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/db-repair-tool At the

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.