I am trying to build my service as GraalVM native image using Spring and buildpacks. My application is Spring Data REST app talking to PostgreSQL database. There is nothing unusual in the code. The image builds with no issues and runs outside of Docker container, but when I am trying to run the generated GraalVM container I am getting an error:
Description:
Native reflection configuration for org.hibernate.dialect.PostgreSQLDialect is missing.
The exception is
Caused by: java.lang.ClassNotFoundException: org.hibernate.dialect.PostgreSQLDialect
at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:71) ~[na:na]
at java.lang.Class.forName(DynamicHub.java:1319) ~[.....:na]
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:130) ~[na:na]
My application.yml:
---
spring:
config:
activate:
on_profile: local
datasource:
url: jdbc:postgresql://localhost:5432/test
username: postgres
password: 1234
driver-class-name: org.postgresql.Driver
jpa:
hibernate:
use-new-id-generator-mappings: false
ddl-auto: none
show-sql: true
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
javax:
persistence:
validation:
mode: none
I know that Spring native image support still has issues, I am just wondering if the problem is on my side.