How can I solve this error:
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_1
This is an issue of Hibernate
, as a workaround you can use the following flag. Then set up the following config in your properties:
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
For Spring boot 2.x.x this flag simply disable contextual LOB creation, but if you really want to know the properly answer check UPDATE V1.
UPDATED V1
This was a Hibernate issue.
If you use Spring Boot latest version from 2.0.x
until 2.1.x
includes Hibernate 5.3.10.final
you can take a look here but this issue was fixed on Hibernate version
5.4.0.CR1 then you need to add that dependency or if it is possible the latest version:
For Gradle:
compile('org.hibernate:hibernate-core:5.4.2.Final')
For Maven:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.2.Final</version>
</dependency>
UPDATED V2 "SPRING BOOT 2.2.0.M(1-4)"
In addition Spring boot v2.2.0.Mx
includes now Hibernate v5.4.x
then this issue was fixed for these versions.
spring:
jpa:
properties:
hibernate:
temp:
use_jdbc_metadata_defaults: false
jdbc:
lob:
non_contextual_creation: true
use_jdbc_metadata_defaults: false or non_contextual_creation: true two items work fine