Announcement Announcement Module
Collapse
No announcement yet.
DuplicateJobConfigurationException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DuplicateJobConfigurationException

    Hi,

    I am building a prototype batch implementation based on the NFL job example. I get the following stacktrace with the NFL job and my own implementation with the latest build of the libraries (1.0-m3-20071120). Both were working fine with (1.0-m3-20071016).

    Does anyone have an idea how to fix this?

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oneoffpaymentjob' defined in class path resource [config/bfi-oop-job.xml]: Initialization of bean failed; nested exception is org.springframework.beans.FatalBeanException: Cannot register job configuration; nested exception is org.springframework.batch.core.configuration.DuplicateJobConfigurationException: A job configuration with this name [oneoffpaymentjob] was already registered
    
    Caused by: org.springframework.beans.FatalBeanException: Cannot register job configuration; nested exception is org.springframework.batch.core.configuration.DuplicateJobConfigurationException: A job configuration with this name [oneoffpaymentjob] was already registered
    
    Caused by: org.springframework.batch.core.configuration.DuplicateJobConfigurationException: A job configuration with this name [oneoffpaymentjob] was already registered
    
            at org.springframework.batch.execution.configuration.MapJobConfigurationRegistry.register(MapJobConfigurationRegistry.java:52)
    
            at org.springframework.batch.execution.configuration.JobConfigurationRegistryBeanPostProcessor.postProcessAfterInitialization(JobConfigurationRegistryBeanPostProcessor.java:93)
    
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:313)
    
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1176)
    
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
    
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249) 
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
    
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246) 
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) 
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
    
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) 
            at org.springframework.test.AbstractSingleSpringContextTests.createApplicationContext(AbstractSingleSpringContextTests.java:199)
    
            at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:179)
    
            at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:158)
    
            at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:105) 
            at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:87) 
            at junit.framework.TestCase.runBare(TestCase.java:128) 
            at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69) 
            at junit.framework.TestResult$1.protect(TestResult.java:106) 
            at junit.framework.TestResult.runProtected(TestResult.java:124) 
            at junit.framework.TestResult.run(TestResult.java:109) 
            at junit.framework.TestCase.run(TestCase.java:120) 
            at junit.framework.TestSuite.runTest(TestSuite.java:230) 
            at junit.framework.TestSuite.run(TestSuite.java:225) 
            at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) 
            at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) 
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) 
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) 
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) 
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

  • #2
    Check your configuration and make sure that only one job configuration with that name is present. How this behaves depends how you deploy the JobConfigurationRegistry, and the way that is handled in the samples was changed recently (which might or might not be the cause of the change you are seeing). You don't have to do it the same way of course.

    Comment


    • #3
      I found my problem. I had two JobConfigurationRegistryBeanPostProcessors in my configuration. One in the job and one in the container configuration. Which causes each bean to be registered twice.

      Thanks for the help.

      Comment

      Working...
      X