tomcat
tomcat copied to clipboard
Tomcat-jdbc causes problem with graalvm
Using the Tomcat-JDBC library inside a Spring Native project causes the compilation step of a GraalVM native image to crash with the given error.
Exception in thread "main" org.springframework.boot.context.properties.bind.MissingParametersCompilerArgumentException: Constructor binding in a native image requires compilation with -parameters but the following classes were compiled without it: org.apache.tomcat.jdbc.pool.PoolProperties$InterceptorProperty
See this little demo project to reproduce the problem.
It seems this error could be easily fixed by adding the -params flag at the compile step, as suggested by the error.
Used Version: JDK GrallVM 21.0.2