Announcement Announcement Module
Collapse
No announcement yet.
Job fails when launched from Spring Batch Admin Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Job fails when launched from Spring Batch Admin

    Hi,

    I have a few Spring Batch jobs that currently run as cron jobs on a server.
    I have Spring Batch Admin setup locally, and I can see the jobs and their history in the Executions menu.
    When I run a job from the server, using a shell script, the job runs fine and I can see the Execution history update.

    However, if I run the job from the Admin app, I can see the job start in console, but then I get an error on an SQLState. This error only happens when launching from Spring Batch:

    2013-05-13 15:44:28,695 [http-8080-4] INFO a.c.s.b.c.support.JobStartEndLogger - Starting Job : chipStrikeMaintenanceJob
    2013-05-13 15:44:29,060 [http-8080-4] INFO a.c.s.b.c.s.ItemLoggingListener - Preparing to read next item.
    2013-05-13 15:44:29,060 [http-8080-4] INFO a.c.s.b.c.s.ItemLoggingListener - Read item : null
    2013-05-13 15:44:29,424 [http-8080-4] INFO a.c.s.b.c.s.ItemLoggingListener - Preparing to read next item.
    2013-05-13 15:44:29,443 [http-8080-4] INFO a.c.s.b.c.s.ItemLoggingListener - Read item : PropertyStrike{ strikeId=15237, strikeType=PENDING, dateCreated=2009-05-15T09:22:59.000+10:00, datePending=2009-05-15T09:22:59.000+10:00, entityType=B, entityId=3980931, reasonText=consumer followup, createdBy=script, propertyId=1}
    2013-05-13 15:44:29,447 [http-8080-4] INFO a.c.s.b.c.s.ItemLoggingListener - Preparing to process item : PropertyStrike{ strikeId=15237, strikeType=PENDING, dateCreated=2009-05-15T09:22:59.000+10:00, datePending=2009-05-15T09:22:59.000+10:00, entityType=B, entityId=3980931, reasonText=consumer followup, createdBy=script, propertyId=1}
    2013-05-13 15:44:29,454 [http-8080-4] INFO a.c.s.b.c.s.ItemLoggingListener - Finished processing item: [PropertyStrike{ strikeId=15237, strikeType=PENDING, dateCreated=2009-05-15T09:22:59.000+10:00, datePending=2009-05-15T09:22:59.000+10:00, entityType=B, entityId=3980931, reasonText=consumer followup, createdBy=script, propertyId=1}] to [au.com.stayz.batch.strikemaintenance.apply.StrikeA dapter@3dda9c8b[propertyStrike=PropertyStrike{ strikeId=15237, strikeType=PENDING, dateCreated=2009-05-15T09:22:59.000+10:00, datePending=2009-05-15T09:22:59.000+10:00, entityType=B, entityId=3980931, reasonText=consumer followup, createdBy=script, propertyId=1}]]
    2013-05-13 15:44:29,455 [http-8080-4] INFO a.c.s.b.c.s.ItemLoggingListener - Preparing to write : 1 items.
    2013-05-13 15:44:29,475 [http-8080-4] INFO a.c.s.b.c.s.ItemLoggingListener - Writing 1 items.
    2013-05-13 15:44:29,580 [http-8080-4] WARN o.h.util.JDBCExceptionReporter - SQL Error: 1048, SQLState: 23000
    2013-05-13 15:44:29,580 [http-8080-4] ERROR o.h.util.JDBCExceptionReporter - Column 'dateWithdrawn' cannot be null
    2013-05-13 15:44:29,587 [http-8080-4] ERROR o.h.e.d.AbstractFlushingEventListener - Could not synchronize database state with session
    org.hibernate.exception.ConstraintViolationExcepti on: Could not execute JDBC batch update
    at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:96) ~[hibernate-core-3.5.1-Final.jar:3.5.1-Final]
    at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:66) ~[hibernate-core-3.5.1-Final.jar:3.5.1-Final]


    I looks like the job has a problem with the 'dateWithdrawn' field, however, when running the job directly from the server, this problem does not occur.

    When running the job from the cmdline, my log file looks fine:

    2013/05/13 16:03:06 - INFO - Job [chipStrikeMaintenanceJob] has started
    2013/05/13 16:03:07 - INFO - Step [createPendingStrikesFromConflicts] has started
    2013/05/13 16:03:07 - INFO - Step [createPendingStrikesFromConflicts] has finished with exit status [exitCode=COMPLETED;exitDescription=]
    2013/05/13 16:03:07 - INFO - Step [processPendingStrikes] has started
    2013/05/13 16:03:08 - INFO - applied strike [15237] on property [1]


    as you can see, there is no problem with strike 15237 on property 1, when the job is run directly from the server.

    Any ideas what the difference between running this job directly on the server, and launching it from the admin app (running locally) could be?

    Thanks

  • #2
    How are your datasources and transaction manager configured in each instance (server and via admin)?

    Comment

    Working...
    X