[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Developing batch processing application using Spring Batch

Posted on 2008-06-16
6
Medium Priority
?
1,437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

656 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