Announcement Announcement Module
Collapse
No announcement yet.
spring batch admin Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring batch admin

    Hello,

    in our project we are providing a db import job with hibernate for GPC classification (http://www.gs1.org/gdsn/gpc) as spring batch application. The job logic is implemented as a tasklet and the batch configuration looks like this:

    Code:
    	<job id="importGpc" job-repository="jobRepository">
    		<step id="importGpcRelease">
    			<tasklet ref="gpcImportJob"/>
    		</step>
    	</job>
    Everything works just fine, when launching the job from Eclipse with CommandLineJobRunner. Good. Now i would like to integrate spring batch admin to launch the job. Integrated the libraries with the jobs and i can deploy the war archive within tomcat 6.0.20. My job gets listed in the job view, but when i launch the job the execution gets stuck in STARTING status and exit code is UNKNOWN. Checking the database confirms that the job never started.

    Does anybody have an idea what's going wrong here?

    Thanks in advance and best regards,

    GLA

  • #2
    Can you launch the sample jobs successfully? If so then I'm guessing maybe a classloader / jar dependency issue. If not then I'm guessing a database connectivity issue, but you haven't really given us any information that could confirm one way or the other. How about posting some logs from the server startup and job launch?

    Comment


    • #3
      Sorry, i should have posted some logs. I attached what is logged after launching my import job. It seems that there is some issue with saving the execution's state. Where does it persist information about jobs and executions by default? The sample jobs fail too, i attached the logged exception in samplejob.txt.
      Last edited by gla-001; Feb 8th, 2010, 09:48 AM.

      Comment


      • #4
        I can see references to MapJobExecutionDao in some of those stack traces, so it looks like you installed a map-based job repository? Bad idea except for the simplest of tests, and you said you were using Hibernate so there has to be a database somewhere. Just leave out the job repository configuration and take the default. Using Hibernate you will need to override the transaction manager, and maybe the data source (or just the properties file that sets it up), and make sure the Batch tables are installed in your database (this is done for you if you leave the entry in the properties file to do with initialization set to true).

        Comment


        • #5
          Thank you Dave, it worked with removing the map-based job repository from the configuration. Still need to override the transaction manager and data source as now the admin ui uses apparently hsql.

          Now i face a minor configuration issue: After my job finished successfully i can't restart the job, because "A job with this name and parameters already completed successfully." Has this something to do with my (still "beta" configuration") or is this a normal behaviour?

          Thanks again for helping!

          Comment


          • #6
            Originally posted by gla-001 View Post
            Has this something to do with my (still "beta" configuration") or is this a normal behaviour?
            It's normal. Change the parameters to launch a new JobInstance. Admin also knows about the JobParametersIncrementer, so if your job has one it will auto-increment the parameters you provide.

            Comment

            Working...
            X