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

  • CommandLineJobRunner on m5

    Hello

    I used to run the fixedLengthImportJob sample job on m4 from the command line with CommandLineJobRunner and these parameters:
    jobs/fixedlengthImportJob.xml fixedlengthImportJob simple-container-definition.xml

    now I changed to m5 and it doesn't work anymore. How should I do it now??
    It shows this error:


    Job Terminated in error:
    org.springframework.beans.factory.BeanDefinitionSt oreException: Invalid bean definition with name 'fixedLengthImportJob' defined in class path resource [jobs/fixedlengthImportJob.xml]: Could not resolve parent bean definition 'simpleJob'; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'simpleJob' is defined
    at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedBeanDefinition(AbstractBeanFa ctory.java:1040)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedBeanDefinition(AbstractBeanFa ctory.java:990)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedLocalBeanDefinition(AbstractB eanFactory.java:976)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:421)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:729)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:381)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:83)
    at org.springframework.batch.execution.launch.support .CommandLineJobRunner.start(CommandLineJobRunner.j ava:194)
    at org.springframework.batch.execution.launch.support .CommandLineJobRunner.main(CommandLineJobRunner.ja va:255)
    Caused by: org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'simpleJob' is defined
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:388)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedLocalBeanDefinition(AbstractB eanFactory.java:976)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedBeanDefinition(AbstractBeanFa ctory.java:743)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedBeanDefinition(AbstractBeanFa ctory.java:1026)
    ... 9 more

  • #2
    As of M5, the command line runner only takes two required arguments, the job context (which should use the <include> tag to include the execution environment) and the job name.

    For more information, see http://jira.springframework.org/browse/BATCH-346.

    There is some ongoing debate as to whether or not this should be undone. Feel free to add your comments to this issue.

    Comment

    Working...
    X