Announcement Announcement Module
No announcement yet.
Invalid JobExecution, ID 0 not found. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Invalid JobExecution, ID 0 not found.

    I知 new to Spring and I知 trying to get my jobRepository working so it actually writes to my Oracle database tables.
    I get the same error regardless of using Oracle or SqlServer for the repository database.
    I know the connection is working based on previous errors but I keep getting this error about Invalid JobExecution, ID 0 not found.
    I知 running the job just once.
    I知 sure I知 missing something basic but have had no luck finding a complete example or solution on the net.
    Any help would be appreciated.

    Here is the exception:

    org.springframework.batch.core.repository.dao.NoSu chObjectException: Invalid JobExecution, ID 0 not found.

  • #2
    Here is my configs

    My applicationContact.xml looks like this:
    <bean id="oraDataSource"
    class="org.springframework.jdbc.datasource.DriverM anagerDataSource"
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
    <property name="url" value="jdbc:oracle:thin:@localhost:1521:xe" />
    <property name="username" value="system" />
    <property name="password" value="password" />

    <bean id="transactionManager"
    class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
    <property name="dataSource" ref="oraDataSource" />

    <bean id="jobRepository2"
    class="org.springframework.batch.core.repository.s upport.JobRepositoryFactoryBean">
    <property name="databaseType" value="oracle" />
    <property name="dataSource" ref="oraDataSource" />
    <property name="transactionManager" ref="transactionManager" />

    My job.xml looks like this:
    <bean id="world" class="BatchProgram1">
    <property name="message" value="World!" />

    <bean id="taskletStep" abstract="true"
    class="org.springframework.batch.core.step.tasklet .TaskletStep">
    <property name="jobRepository" ref="jobRepository2" />

    <bean id="myJob" class="org.springframework.batch.core.job.SimpleJo b">
    <property name="name" value="simpleJob" />
    <property name="steps">
    <bean parent="taskletStep">
    <property name="tasklet" ref="world" />

    <property name="jobRepository" ref="jobRepository2" />


    • #3
      Why is it called 'jobRepository2' ? Do you have more than one?


      • #4
        You know, for such a simple answer... It worked. I was loading multiple repositories and that was the problem. I removed the other memory-based repository and everything worked !!!