Solved

Developing batch processing application using Spring Batch

Posted on 2008-06-16
6
1,381 Views
Last Modified: 2013-11-13
Hello Experts,

I need to develop a batch processing application using Spring Batch, I am not sure where to start from.
If you can please provide me with some sample application /source code.

Thanks in advance
0
Comment
Question by:annapolistech
  • 3
  • 3
6 Comments
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 21827396
I believe you are talking about the framework found at http://static.springframework.org/spring-batch/ .  If so that is a good place to start.  The documentation links on the left side of that page have "Use Cases", a User Guide, etc that seem to be inforrmative.  I don't know that framework so I can't say how helpful it is but there were some examples and help.  It would be my first start.

If you need more help then I can try to provide some more info but I would also point out the Forum link.

Since it is a framework are you using it with a specific language or environment?  That may be important for finding the best examples and info on using this.

Let me know how this helps or if you have a question.

bol
0
 

Author Comment

by:annapolistech
ID: 21844029
Hi,
Thanks for your reply.
I am developing a batch processing system in Java, using Spring Batch.
I did manage to run the sample application posted on the following URL

http://www.jroller.com/0xcafebabe/entry/spring_batch_hello_world_1

I had some issues running the sample code, but I have managed to fix those, using a tweak as follows.
There is a Maven batch file (job.bat) which needs a couple of parameters from a .java file  to kick off the batch processing.

I had a problem in starting the batch process using the .bat file, so I used another .java file which functions exactly like the .bat file to start the processing.

Can you go through the .bat file and let me know whether I can rewrite the batch file without using Maven.

Since this is a relatively new concept, there is very little documentation available.

Thanks again for your help.
Following is the .bat file
 

mvn clean compile exec:java -Dexec.mainClass=org.springframework.batch.core.launch.support.CommandLineJobRunner -Dexec.args="simpleJob.xml simpleJob"

Open in new window

0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 21848039
The line above depends on Maven.  The first "word" is the command to run Maven's program file.  The rest are arguments and info on how or what to run.

Having said that I don't believe you have to use Maven.  It seems like Maven is just a tool to manage the build.  You should be able to do the build without it although you may have to find and fix what is causing the error.  The "non-Maven" version of the line above would be ...

java org.springframework.batch.core.launch.support.CommandLineJobRunner "simpleJob.xml simpleJob"

I don't know if ther arguments (the part in quotes) need the quotes or if there are really two arguments.  If you are missing some "dependencies" then that may explain the error but successful build with Maven, which will download them and help with that part.

I hope this helps and answers you latest question.  Let me know if you have a problem or question.  If you need a lot of help with Maven then it might help to open a new question for it.

bol
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:annapolistech
ID: 21852965
Hi bol,

Thanks again for your solution.
I have tried using,
java org.springframework.batch.core.launch.support.CommandLineJobRunner "simpleJob.xml simpleJob"
but may be due to some class path issue, the batch file is not executing.
I'll try againg doing some modification in the batch file
There are two arguments present in the .bat file - simpleJob.xml and simpleJob

Thanks

0
 

Author Comment

by:annapolistech
ID: 21873266
Hi boI,

Thanks for your assistance.  Since this a relatively new technology, there is very less material available to go through. I guess trying out different things will eventually make it clearer and understandable.
So I am closing this question now.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 21876128
Your welcome!  I'm glad I could help and sorry I couldn't help more with Maven.  Thanks for the fun question, the grade and the points.

bol
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now