1

For security purpose I have to migrate my H2 library from 1.4.200 to 2.1.214 in my Spring Batch application

In 1.4.200 version, all my Junit test are OK but with new version, start of the application failed :

Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "BATCH_JOB_INSTANCE" not found (this database is empty); SQL statement:
SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? and JOB_KEY = ? [42104-214]

I have juste change H2 version in my pom.xml

Spring Batch application use Spring Boot 2.1.11.RELEASE dependencies.

Do you know why this tables aren't find ?

 spring:
    application:
        name: myBatch
    cache:
        type: simple
    datasource:
        type: com.zaxxer.hikari.HikariDataSource
        url: jdbc:h2:mem:myBatch;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
        name:
        username:
        password:
        hikari:
            auto-commit: false
5
  • How are the tables created? Dec 8, 2022 at 15:50
  • By Spring Batch, it's native
    – Broshet
    Dec 8, 2022 at 16:37
  • Do you have spring.batch.initialize-schema=always Dec 8, 2022 at 17:29
  • By Spring Batch, it's native: Spring Batch does not create tables, you probably mean Spring Boot. According to the error, the table does not exist, meaning the table is not created as you might think. Please share a minimal example that reproduces the issue to be able to help you efficiently. Dec 9, 2022 at 9:00
  • Which version of Spring Framework and Spring Batch are you using? For H2 2.x you need at least Spring Framework 5.3.15 and Spring Batch 4.3.5.
    – Henning
    Dec 16, 2022 at 9:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.