Announcement Announcement Module
Collapse
No announcement yet.
Invalid JobExecution, ID 0 not found. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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.
    Ed

    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"
    destroy-method="close">
    <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>

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


    <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" />
    </bean>

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

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

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

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

    Comment


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

      Comment


      • #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 !!!
        Thanks

        Comment

        Working...
        X