Announcement Announcement Module
Collapse
No announcement yet.
Parent Context Bean References Missing Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Parent Context Bean References Missing

    Hello,

    Hopefully this is a simple question. I have a configuration that sets up several jobs. My infrastructure code sets up a job registry which then uses the registry to retrieve a job by name based on some criteria that is dynamically passed in. Once a job is identified, it is retrieved from the registry and launched.

    Here is an example of my registry def in my infrastructure xml:

    Code:
    	<bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.ClassPathXmlJobRegistry">
    		<property name="jobPaths">
    			<list>					
    				<value>WEB-INF/jobs/...

    My problem is that when I go to reference a bean that is defined in my infrastructure context (service bean, dao, etc..), they are not found.

    Is there a better way to set this up? I need the ability to define several jobs and pull them out of a registry dynamically. It's clear that the job fished out of the registry does not contain references to beans in the parent context. I'd like to make this possible.

    Thanks,

    Alejandro

  • #2
    What is your "infrastructure context"? If it is the one containing the ClassPathXmlJobRegistry then its beans should be available for DI in the child contexts. What is it that you see going wrong?

    Comment

    Working...
    X