PDA

View Full Version : Getting Started with Spring batch


Nagarajan
Nov 28th, 2007, 07:49 AM
Hi,
I have installed maven and have all the spring batch jar files including the samples jar file. Can someone please help me to run the samples to get started ?

Thanks
Naga

Dave Syer
Nov 28th, 2007, 12:31 PM
If I were you I would get the source code for the samples (and then the easiest way is to get all the source code for the whole project - I think we might try to make that easier). Then just do

$ mvn test

on the command line. Or use your IDE to run the unit tests in the samples project.

Nagarajan
Nov 28th, 2007, 01:20 PM
Dave, I'm using Jdeveloper as the IDE. I have the source code of the samples imported to the ide as a project and I don't see any unit test java files.

Thanks
Naga

Nagarajan
Nov 29th, 2007, 02:23 AM
Hi,
I was able to figure out how to run the samples. I tried running nfljob....and I get this error in the log.

Nov 29, 2007 12:31:37 PM org.springframework.batch.execution.bootstrap.supp ort.BatchCommandLineLauncher start
SEVERE: org.springframework.beans.factory.access.Bootstrap Exception: Unable to return specified BeanFactory instance: factory key [batchExecutionEnvironment], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'batchExecutionEnvironment' is defined
Process exited with exit code 1.

robert.kasanicky
Nov 29th, 2007, 03:18 AM
NFL job takes rather long to run, so I think it is broken deliberately as a temporary workaround to speed up running of the test suite as a whole.

Dave Syer
Nov 29th, 2007, 01:43 PM
I don't think it is broken - I can run it anyway. The error is saying that the beanRefContext.xml from the claspath does not contain a bean definition called "batchExecutionEnvironment". I'm not sure where that came from as the beanRefContext that we ship has "simple-container" as the context (I just fixed that http://opensource.atlassian.com/projects/spring/browse/BATCH-239). Maybe you need to launch it with -Dbatch.execution.environment.key=simple-container?