Closed acemoo closed 1 year ago
Please report the issue against the Cassandra driver directly. All those linked tickets seem like workarounds.
Can you attach a trace from where the initialization of Dependency
is triggered?
Initialization stack trace shows that com.datastax.oss.driver.internal.core.util.Dependency
is initialized by a substitution shipped in the Cassandra driver:
Error: Classes that should be initialized at run time got initialized during image building:
com.datastax.oss.driver.internal.core.util.Dependency was unintentionally initialized at build time. com.datastax.oss.driver.internal.core.util.Dependency caused initialization of this class with the following trace:
at com.datastax.oss.driver.internal.core.util.Dependency.<clinit>(Dependency.java:33)
at com.datastax.dse.driver.internal.core.type.codec.DseTypeCodecsRegistrarSubstitutions$EsriMissing.getAsBoolean(DseTypeCodecsRegistrarSubstitutions.java:42)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.findTargetClass(AnnotationSubstitutionProcessor.java:1014)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleClass(AnnotationSubstitutionProcessor.java:364)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.init(AnnotationSubstitutionProcessor.java:342)
at com.oracle.svm.hosted.NativeImageGenerator.createAnnotationSubstitutionProcessor(NativeImageGenerator.java:966)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:868)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:575)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:535)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:580)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
A bit of a slow response from my side, Just got time to dive into this again. Seems it will be solved in 4.15.1 https://datastax-oss.atlassian.net/browse/JAVA-3045
Hello @acemoo , thank you for finding this issue.
Do you know if there is a way to import 4.15.1 to the current SpringBoot 3.0.2 or 3.0.3 snapshot please?
4.15.1 isn't released yet. In any case, you can override the Spring Boot property cassandra-driver.version
with <cassandra-driver.version>4.15.1</cassandra-driver.version>
.
Many thanks @mp911de, I will wait for the release of 4.15.1 and apply what you said
When trying to natively compile a project that has both
spring-boot-starter-data-cassandra
andspring-cloud-starter-stream-kafka
usingmvn clean -Pnative native:compile
I'm getting the following error:Here's a minimal project that shows the problem: https://github.com/acemoo/spring-native-cloud-kafka-data-cassandra
I found a similar issue with Micronaut https://github.com/micronaut-projects/micronaut-cassandra/issues/263 With a solution https://github.com/micronaut-projects/micronaut-cassandra/pull/264/files Unfortunately, I couldn't find any
--initialize-at-build-time
in either Spring Boot or Spring Data Cassandra.