Hi @all,
I am not that far to execute the first step. I recently used Hivemind as IOC (Unfortunately - but it was company policy in those days) and want to move to Spring now, so there might be some lacks concerning Spring as well.
I did everything as explained in the example, but somehow the PlatformTransactionManager is null, which results in the following stacktrace.
Can anyone tell me if - any how - I have to define the TransactionManager myself in this example.v
Code:
2008-11-07 11:51:39,012 INFO org.springframework.context.support.ClassPathXmlApplicationContext:412 - Refreshing org.springframework.context.support.
ClassPathXmlApplicationContext@cade31: display name [org.springframework.context.support.ClassPathXmlApplicationContext@cade31]; startup date [Fri Nov
07 11:51:39 CET 2008]; root of context hierarchy
2008-11-07 11:51:39,079 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader:323 - Loading XML bean definitions from class path resourc
e [simpleJob.xml]
2008-11-07 11:51:39,290 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader:323 - Loading XML bean definitions from class path resourc
e [applicationContext.xml]
2008-11-07 11:51:39,348 INFO org.springframework.context.support.ClassPathXmlApplicationContext:427 - Bean factory for application context [org.sprin
gframework.context.support.ClassPathXmlApplicationContext@cade31]: org.springframework.beans.factory.support.DefaultListableBeanFactory@14ed577
2008-11-07 11:51:39,368 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory:414 - Pre-instantiating singletons in org.springfra
mework.beans.factory.support.DefaultListableBeanFactory@14ed577: defining beans [jobLauncher,jobRepository,hello,space,world,taskletStep,simpleJob]; r
oot of factory hierarchy
2008-11-07 11:51:39,454 INFO org.springframework.batch.core.launch.support.SimpleJobLauncher:161 - No TaskExecutor has been set, defaulting to synchr
onous executor.
2008-11-07 11:51:39,537 INFO org.springframework.batch.core.launch.support.SimpleJobLauncher:114 - Job: [SimpleJob: [name=simpleJob]] launched with t
he following parameters: [{}]
2008-11-07 11:51:39,575 ERROR org.springframework.batch.core.step.AbstractStep:220 - Encountered an error executing the step: class java.lang.NullPoin
terException: null
java.lang.NullPointerException
at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInStepContext(TaskletStep.java:247)
at org.springframework.batch.core.scope.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:67)
at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:352)
at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:212)
at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143)
at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:230)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:198)
at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:330)
at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:78)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:228)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:115)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:110)
at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:204)
at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:251)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
at java.lang.Thread.run(Thread.java:619)
2008-11-07 11:51:39,599 INFO org.springframework.batch.core.launch.support.SimpleJobLauncher:116 - Job: [SimpleJob: [name=simpleJob]] completed with
the following parameters: [{}] and the following status: [FAILED]
2008-11-07 11:51:39,601 INFO org.springframework.context.support.ClassPathXmlApplicationContext:816 - Closing org.springframework.context.support.Cla
ssPathXmlApplicationContext@cade31: display name [org.springframework.context.support.ClassPathXmlApplicationContext@cade31]; startup date [Fri Nov 07
11:51:39 CET 2008]; root of context hierarchy
2008-11-07 11:51:39,603 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory:399 - Destroying singletons in org.springframework.
beans.factory.support.DefaultListableBeanFactory@14ed577: defining beans [jobLauncher,jobRepository,hello,space,world,taskletStep,simpleJob]; root of
factory hierarchy
Thanks for your help.
Thomas