Files
hibernate-demo/docs/output/persistenceannotations-json-no-formatmapper.txt

18 lines
937 B
Plaintext

@JdbcTypeCode(SqlTypes.JSON) with NO JSON provider on the classpath.
Reproduced by removing tools.jackson.core:jackson-databind and excluding
spring-boot-starter-jackson from spring-boot-starter-web, leaving zero JSON
providers on the test classpath:
$ mvn -o -B dependency:list -DincludeScope=test | grep -icE 'jackson-databind|yasson|johnzon'
0
$ mvn -o -B test -Dtest=JsonColumnOnH2Test
org.hibernate.HibernateException: Could not find a FormatMapper for the JSON format, which is required for mapping JSON types. JSON FormatMapper configuration is automatic, but requires that you have either Jackson or a JSONB implementation like Yasson on the class path.
Put either Jackson or a JSONB implementation back on the classpath and the same
test passes. spring-boot-starter-data-jpa on its own does not bring one:
$ mvn -o -B test -Dtest=JsonColumnOnH2Test # with tools.jackson.core:jackson-databind present
[INFO] BUILD SUCCESS