aspose file tools*
The moose likes Spring and the fly likes Running a batch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Running a batch" Watch "Running a batch" New topic
Author

Running a batch

Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183
I have got another thread running but I think thats got too much data Forum link

I was trying to run the example in the Spring batch documentation but I can't seem to autowire the right classes. Couldn't correlate it to any sample in the spring samples also. Could someone guide me.



My configuration




Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Is that the actual code, or are you missing method name?

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183
Just the method name ;-) I thought it was insignificant. Was trying to make it as readable as possible. I even got the package names in.

This is straight out of the Spring documentation. Haven't changed anything. All three methods seem to be syntactically wrong.
createJobExecution
saveOrUpdate
createJobExecution

Got some success kick-starting the batch with quartz.SchedulerFactoryBean so was trying my luck with that but please do let me know if you can find something amiss here.

And Mark, you had mentioned in the previous post that the Spring Batch documentation it good. I woudln't disagree but a quick-start guide or a 3-step guide (whatever) would have helped.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

Ok its not clear what the problem you facing is - but if your trying to run the job then the commandLineJobRunner does all the hardwork,

More here

If your just tetsing (Say Junit) the @SpringRunner all with JobLauncherTestUtils takes care of all the plumbing code.
End To End Testing

In all the Batch Jobs I have written I never reference JobRepository - There enough help to do all the plumbing!

As for a 3-4 page guide to Spring Batch - I agree its a good idea. So why don't you start one? You already seem to have a 'nice' start up guide post here where you kind of gone through the steps!
I do suggest giving the whole Spring Batch documentation a read, it does cover everything.


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
 
Don't get me started about those stupid light bulbs.
 
subject: Running a batch