komapper
komapper copied to clipboard
Build of native image with komapper-spring-native-r2dbc fails
Describe the bug
Gradle "bootBuildImage" task fails.
Expected behavior
Task execution succeeds.
Actual behavior
Task execution fails:
> Task :spring-native-r2dbc:bootBuildImage
Building image 'docker.io/library/spring-native-r2dbc:0.0.1'
> Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' ..................................................
> Pulled builder image 'paketobuildpacks/builder@sha256:eeecbc0e66185ed4a929168214051b3f92553f4d448ea59f224cff78e3abb83f'
> Pulling run image 'docker.io/paketobuildpacks/run:tiny-cnb' ..................................................
> Pulled run image 'paketobuildpacks/run@sha256:ecc1c097c43a313151bbcb544b4b6c17ec808e93707a777e01c1e5b37d4dd6bc'
> Executing lifecycle version v0.13.4
> Using build cache volume 'pack-cache-ae4daa2157d0.build'
> Running creator
[creator] ===> ANALYZING
[creator] ===> DETECTING
[creator] 6 of 14 buildpacks participating
[creator] paketo-buildpacks/ca-certificates 3.1.0
[creator] paketo-buildpacks/bellsoft-liberica 9.2.0
[creator] paketo-buildpacks/syft 1.10.0
[creator] paketo-buildpacks/executable-jar 6.1.0
[creator] paketo-buildpacks/spring-boot 5.8.0
[creator] paketo-buildpacks/native-image 5.2.0
[creator] ===> RESTORING
[creator] Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[creator] Restoring metadata for "paketo-buildpacks/bellsoft-liberica:native-image-svm" from cache
[creator] Restoring metadata for "paketo-buildpacks/syft:syft" from cache
[creator] Restoring metadata for "paketo-buildpacks/native-image:native-image" from cache
[creator] Restoring data for "paketo-buildpacks/bellsoft-liberica:native-image-svm" from cache
[creator] Restoring data for "paketo-buildpacks/syft:syft" from cache
[creator] Restoring data for "paketo-buildpacks/native-image:native-image" from cache
[creator] ===> BUILDING
[creator]
[creator] Paketo CA Certificates Buildpack 3.1.0
[creator] https://github.com/paketo-buildpacks/ca-certificates
[creator] Launch Helper: Contributing to layer
[creator] Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper
[creator]
[creator] Paketo BellSoft Liberica Buildpack 9.2.0
[creator] https://github.com/paketo-buildpacks/bellsoft-liberica
[creator] Build Configuration:
[creator] $BP_JVM_TYPE JRE the JVM type - JDK or JRE
[creator] $BP_JVM_VERSION 11.* the Java version
[creator] Launch Configuration:
[creator] $BPL_DEBUG_ENABLED false enables Java remote debugging support
[creator] $BPL_DEBUG_PORT 8000 configure the remote debugging port
[creator] $BPL_DEBUG_SUSPEND false configure whether to suspend execution until a debugger has attached
[creator] $BPL_HEAP_DUMP_PATH write heap dumps on error to this path
[creator] $BPL_JAVA_NMT_ENABLED true enables Java Native Memory Tracking (NMT)
[creator] $BPL_JAVA_NMT_LEVEL summary configure level of NMT, summary or detail
[creator] $BPL_JFR_ARGS configure custom Java Flight Recording (JFR) arguments
[creator] $BPL_JFR_ENABLED false enables Java Flight Recording (JFR)
[creator] $BPL_JMX_ENABLED false enables Java Management Extensions (JMX)
[creator] $BPL_JMX_PORT 5000 configure the JMX port
[creator] $BPL_JVM_HEAD_ROOM 0 the headroom in memory calculation
[creator] $BPL_JVM_LOADED_CLASS_COUNT 35% of classes the number of loaded classes in memory calculation
[creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[creator] BellSoft Liberica NIK 11.0.14: Contributing to layer
[creator] Downloading from https://download.bell-sw.com/vm/22.0.0.2/bellsoft-liberica-vm-core-openjdk11-22.0.0.2-linux-amd64.tar.gz
[creator] Verifying checksum
[creator] Expanding to /layers/paketo-buildpacks_bellsoft-liberica/native-image-svm
[creator] Adding 128 container CA certificates to JVM truststore
[creator] Writing env.build/JAVA_HOME.override
[creator] Writing env.build/JDK_HOME.override
[creator]
[creator] Paketo Syft Buildpack 1.10.0
[creator] https://github.com/paketo-buildpacks/syft
[creator] Downloading from https://github.com/anchore/syft/releases/download/v0.41.1/syft_0.41.1_linux_amd64.tar.gz
[creator] Verifying checksum
[creator] Writing env.build/SYFT_CHECK_FOR_APP_UPDATE.default
[creator]
[creator] Paketo Executable JAR Buildpack 6.1.0
[creator] https://github.com/paketo-buildpacks/executable-jar
[creator] Class Path: Contributing to layer
[creator] Writing env.build/CLASSPATH.delim
[creator] Writing env.build/CLASSPATH.prepend
[creator]
[creator] Paketo Spring Boot Buildpack 5.8.0
[creator] https://github.com/paketo-buildpacks/spring-boot
[creator] Build Configuration:
[creator] $BP_SPRING_CLOUD_BINDINGS_ENABLED true whether to contribute Spring Boot cloud bindings support
[creator] Launch Configuration:
[creator] $BPL_SPRING_CLOUD_BINDINGS_DISABLED false whether to auto-configure Spring Boot environment properties from bindings
[creator] $BPL_SPRING_CLOUD_BINDINGS_ENABLED true Deprecated - whether to auto-configure Spring Boot environment properties from bindings
[creator] Class Path: Contributing to layer
[creator] Writing env.build/CLASSPATH.append
[creator] Writing env.build/CLASSPATH.delim
[creator] Image labels:
[creator] org.springframework.boot.version
[creator] Warning: BOM table is deprecated in this buildpack api version, though it remains supported for backwards compatibility. Buildpack authors should write BOM information to <layer>.sbom.<ext>, launch.sbom.<ext>, or build.sbom.<ext>.
[creator]
[creator] Paketo Native Image Buildpack 5.2.0
[creator] https://github.com/paketo-buildpacks/native-image
[creator] Build Configuration:
[creator] $BP_BINARY_COMPRESSION_METHOD Compression mechanism used to reduce binary size. Options: `none` (default), `upx` or `gzexe`
[creator] $BP_NATIVE_IMAGE true enable native image build
[creator] $BP_NATIVE_IMAGE_BUILD_ARGUMENTS arguments to pass to the native-image command
[creator] $BP_NATIVE_IMAGE_BUILD_ARGUMENTS_FILE a file with arguments to pass to the native-image command
[creator] $BP_NATIVE_IMAGE_BUILT_ARTIFACT the built application artifact explicitly, required if building from a JAR
[creator] Native Image: Contributing to layer
[creator] GraalVM 22.0.0.2 Java 11 CE (Java Version 11.0.14.1+1-LTS)
[creator] Executing native-image -H:+StaticExecutableWithDynamicLibC -H:Name=/layers/paketo-buildpacks_native-image/native-image/org.komapper.example.ApplicationKt -cp /workspace:/workspace/BOOT-INF/classes:/workspace/BOOT-INF/lib/spring-native-r2dbc-0.0.1-aot.jar:/workspace/BOOT-INF/lib/komapper-spring-boot-starter-r2dbc-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/komapper-spring-native-r2dbc-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/komapper-dialect-h2-r2dbc-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/kotlinx-coroutines-reactor-1.6.0.jar:/workspace/BOOT-INF/lib/komapper-spring-boot-autoconfigure-r2dbc-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/komapper-spring-r2dbc-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/komapper-r2dbc-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/kotlinx-coroutines-reactive-1.6.0.jar:/workspace/BOOT-INF/lib/komapper-annotation-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/komapper-template-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/komapper-slf4j-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/komapper-dialect-h2-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/komapper-tx-core-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/komapper-core-0.30.1-SNAPSHOT.jar:/workspace/BOOT-INF/lib/kotlinx-coroutines-core-1.6.0.jar:/workspace/BOOT-INF/lib/kotlinx-coroutines-core-jvm-1.6.0.jar:/workspace/BOOT-INF/lib/kotlin-stdlib-jdk8-1.6.10.jar:/workspace/BOOT-INF/lib/spring-native-0.11.3.jar:/workspace/BOOT-INF/lib/jackson-datatype-jdk8-2.13.1.jar:/workspace/BOOT-INF/lib/jackson-datatype-jsr310-2.13.1.jar:/workspace/BOOT-INF/lib/jackson-module-parameter-names-2.13.1.jar:/workspace/BOOT-INF/lib/jackson-databind-2.13.1.jar:/workspace/BOOT-INF/lib/jackson-annotations-2.13.1.jar:/workspace/BOOT-INF/lib/jackson-core-2.13.1.jar:/workspace/BOOT-INF/lib/jackson-module-kotlin-2.13.1.jar:/workspace/BOOT-INF/lib/kotlin-stdlib-jdk7-1.6.10.jar:/workspace/BOOT-INF/lib/kotlinx-serialization-json-jvm-1.3.2.jar:/workspace/BOOT-INF/lib/kotlin-reflect-1.6.10.jar:/workspace/BOOT-INF/lib/kotlinx-serialization-core-jvm-1.3.2.jar:/workspace/BOOT-INF/lib/kotlin-stdlib-1.6.10.jar:/workspace/BOOT-INF/lib/spring-boot-autoconfigure-2.7.0-M2.jar:/workspace/BOOT-INF/lib/spring-boot-2.7.0-M2.jar:/workspace/BOOT-INF/lib/spring-context-5.3.16.jar:/workspace/BOOT-INF/lib/spring-r2dbc-5.3.16.jar:/workspace/BOOT-INF/lib/spring-tx-5.3.16.jar:/workspace/BOOT-INF/lib/spring-webflux-5.3.16.jar:/workspace/BOOT-INF/lib/spring-web-5.3.16.jar:/workspace/BOOT-INF/lib/spring-aop-5.3.16.jar:/workspace/BOOT-INF/lib/spring-beans-5.3.16.jar:/workspace/BOOT-INF/lib/spring-expression-5.3.16.jar:/workspace/BOOT-INF/lib/spring-core-5.3.16.jar:/workspace/BOOT-INF/lib/r2dbc-pool-0.9.0.RELEASE.jar:/workspace/BOOT-INF/lib/r2dbc-h2-0.9.1.RELEASE.jar:/workspace/BOOT-INF/lib/annotations-13.0.jar:/workspace/BOOT-INF/lib/kotlin-stdlib-common-1.6.10.jar:/workspace/BOOT-INF/lib/r2dbc-spi-0.9.1.RELEASE.jar:/workspace/BOOT-INF/lib/spring-jcl-5.3.16.jar:/workspace/BOOT-INF/lib/reactor-pool-0.2.7.jar:/workspace/BOOT-INF/lib/reactor-netty-http-1.0.16.jar:/workspace/BOOT-INF/lib/reactor-netty-core-1.0.16.jar:/workspace/BOOT-INF/lib/reactor-core-3.4.15.jar:/workspace/BOOT-INF/lib/jakarta.annotation-api-1.3.5.jar:/workspace/BOOT-INF/lib/snakeyaml-1.30.jar:/workspace/BOOT-INF/lib/reactive-streams-1.0.3.jar:/workspace/BOOT-INF/lib/logback-classic-1.2.10.jar:/workspace/BOOT-INF/lib/log4j-to-slf4j-2.17.1.jar:/workspace/BOOT-INF/lib/jul-to-slf4j-1.7.36.jar:/workspace/BOOT-INF/lib/slf4j-api-1.7.36.jar:/workspace/BOOT-INF/lib/h2-2.1.210.jar:/workspace/BOOT-INF/lib/netty-codec-http2-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-handler-proxy-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-codec-http-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-resolver-dns-native-macos-4.1.74.Final-osx-x86_64.jar:/workspace/BOOT-INF/lib/netty-resolver-dns-classes-macos-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-resolver-dns-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-transport-native-epoll-4.1.74.Final-linux-x86_64.jar:/workspace/BOOT-INF/lib/logback-core-1.2.10.jar:/workspace/BOOT-INF/lib/log4j-api-2.17.1.jar:/workspace/BOOT-INF/lib/netty-handler-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-codec-dns-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-codec-socks-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-codec-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-transport-classes-epoll-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-transport-native-unix-common-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-transport-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-buffer-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-resolver-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-common-4.1.74.Final.jar:/workspace/BOOT-INF/lib/netty-tcnative-classes-2.0.48.Final.jar org.komapper.example.ApplicationKt
[creator] ================================================================================
[creator] GraalVM Native Image: Generating '/layers/paketo-buildpacks_native-image/native-image/org.komapper.example.ApplicationKt'...
[creator] ================================================================================
[creator] [1/7] Initializing...
[creator] (16.4s @ 0.10GB)
[creator] Error: Could not find target method: private java.util.List org.springframework.nativex.substitutions.boot.Target_FailureAnalyzers.loadFailureAnalyzers(org.springframework.context.ConfigurableApplicationContext,java.lang.ClassLoader)
[creator] Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
[creator] --------------------------------------------------------------------------------
[creator] 1.0s (8.8% of total time) in 14 GCs | Peak RSS: 0.78GB | CPU load: 3.21
[creator] --------------------------------------------------------------------------------
[creator] Produced artifacts:
[creator] /layers/paketo-buildpacks_native-image/native-image/org.komapper.example.ApplicationKt.build_artifacts.txt
[creator] ================================================================================
[creator] Failed generating '/layers/paketo-buildpacks_native-image/native-image/org.komapper.example.ApplicationKt' after 9.8s.
[creator] Error: Image build request failed with exit status 1
[creator] unable to invoke layer creator
[creator] unable to contribute native-image layer
[creator] error running build
[creator] exit status 1
[creator] ERROR: failed to build: exit status 1
> Task :spring-native-r2dbc:bootBuildImage FAILED
Steps to reproduce the problem
- Clone komapper-examples.
- Execute
./gradlew clean :spring-native-r2dbc:bootBuildImage
Versions
- Komapper: https://github.com/komapper/komapper/commit/84c33d8249d09da0f995946cfb2b95c004b213d7
- Kotlin: 1.6.10
- JVM: 11.0.13-zulu
- JDBC Driver or R2DBC Driver: 0.9.1.RELEASE
- Database: H2 Database Engine 2.1.210
- OS: Mac OS X 12.1 x86_64