Repository navigation
LinkedHashSet.<init>() method not found #1257
Description
Hello guys,
in our test-application for spring-native builds/starts are failing since today.
With the spring-native release of yesterday building and starting was successful.
Build is working fine, but when we start the application we got a NoSuchMethodException.
This is the failing log of the application:
app | 10:40:40.386 [main] INFO org.springframework.boot.SpringApplication - AOT mode enabled app | 10:40:40.392 [main] DEBUG org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - Application failed to start due to an exception app | java.lang.NoSuchMethodException: java.util.LinkedHashSet.<init>() app | at java.lang.Class.getConstructor0(DynamicHub.java:3585) app | at java.lang.Class.getDeclaredConstructor(DynamicHub.java:2754) app | at org.springframework.util.ReflectionUtils.accessibleConstructor(ReflectionUtils.java:185) app | at org.springframework.core.CollectionFactory.createCollection(CollectionFactory.java:208) app | at org.springframework.core.convert.support.CollectionToCollectionConverter.convert(CollectionToCollectionConverter.java:81) app | at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:41) app | at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:192) app | at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:109) app | at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:100) app | at org.springframework.boot.context.properties.bind.IndexedElementsBinder.convert(IndexedElementsBinder.java:142) app | at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindValue(IndexedElementsBinder.java:97) app | at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:83) app | at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:70) app | at org.springframework.boot.context.properties.bind.CollectionBinder.bindAggregate(CollectionBinder.java:49) app | at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:56) app | at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$3(Binder.java:435) app | at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:587) app | at org.springframework.boot.context.properties.bind.Binder$Context.access$100(Binder.java:534) app | at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:435) app | at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:396) app | at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:340) app | at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:329) app | at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:259) app | at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:220) app | at org.springframework.boot.context.config.Profiles.getProfiles(Profiles.java:101) app | at org.springframework.boot.context.config.Profiles.getActivatedProfiles(Profiles.java:88) app | at org.springframework.boot.context.config.Profiles.<init>(Profiles.java:82) app | at org.springframework.boot.context.config.ConfigDataEnvironment.withProfiles(ConfigDataEnvironment.java:275) app | at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:231) app | at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:102) app | at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:94) app | at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102) app | at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87) app | at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) app | at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) app | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) app | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) app | at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) app | at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) app | at java.util.ArrayList.forEach(ArrayList.java:1511) app | at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) app | at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) app | at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) app | at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:338) app | at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) app | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) app | at org.springframework.boot.SpringApplication.run(SpringApplication.java:1279) app | at de.local.test.nativetest.NativeTestApplication.main(NativeTestApplication.java:10) app | 10:40:40.392 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - app | app | *************************** app | APPLICATION FAILED TO START app | *************************** app | app | Description: app | app | Native reflection configuration for java.util.LinkedHashSet.<init>() is missing. app | app | Action: app | app | Native configuration for a method accessed reflectively is likely missing. app | You can try to configure native hints in order to specify it explicitly. app | See https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#native-hints for more details. app |
Log of Build:
`2021-11-12 11:31:56.109 INFO 62364 --- [ main] o.s.a.build.ContextBootstrapContributor : Detected application class: de.local.test.nativetest.NativeTestApplication
2021-11-12 11:31:56.117 INFO 62364 --- [ main] o.s.a.build.ContextBootstrapContributor : Processing application context
2021-11-12 11:31:58.002 INFO 62364 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data MongoDB repositories in DEFAULT mode.
2021-11-12 11:31:58.075 INFO 62364 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 68 ms. Found 1 MongoDB repository interfaces.
MongoDBRef proxies: []
2021-11-12 11:32:02.497 INFO 62364 --- [ main] o.s.a.build.ContextBootstrapContributor : Processed 304 bean definitions in 6371ms
2021-11-12 11:32:04.245 INFO 62364 --- [ main] o.s.nativex.support.SpringAnalyzer : Spring Native operating mode: native
MongoDBRef proxies: []
Task :compileAotMainJava
warning: unknown enum constant When.MAYBE
reason: class file for javax.annotation.meta.When not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
Task :bootBuildImage
Building image 'docker.markant.com/native-test:0.0.1'
Pulling builder image 'docker.markant.com/cloud-services/utils/base-images/paketobuildpacks/builder:tiny' ..................................................
Pulled builder image 'docker.markant.com/cloud-services/utils/base-images/paketobuildpacks/builder@sha256:baa5d328d1e6cea79c86e5f94b72702be7364752e88414ddd4a47e87ebc3c627'
Pulling run image 'docker.markant.com/cloud-services/utils/base-images/paketobuildpacks/run:tiny-cnb' ..................................................
Pulled run image 'docker.markant.com/cloud-services/utils/base-images/paketobuildpacks/run@sha256:85e5824609dbb20c5e5afb33ed96bff8a52a108a58a315b4509e663dbe01402d'
Executing lifecycle version v0.12.0
Using build cache volume 'pack-cache-c2c0ee3fa414.build'
Running creator
[creator] ===> DETECTING
[creator] 5 of 13 buildpacks participating
[creator] paketo-buildpacks/ca-certificates 2.4.2
[creator] paketo-buildpacks/graalvm 6.7.0
[creator] paketo-buildpacks/executable-jar 5.3.1
[creator] paketo-buildpacks/spring-boot 4.7.0
[creator] paketo-buildpacks/native-image 4.3.2
[creator] ===> ANALYZING
[creator] Previous image with name "" not found
[creator] Restoring metadata for "paketo-buildpacks/ca-certificates:helper" from app image
[creator] Restoring metadata for "paketo-buildpacks/graalvm:jdk" from cache
[creator] Restoring metadata for "paketo-buildpacks/native-image:native-image" from cache
[creator] ===> RESTORING
[creator] Restoring data for "paketo-buildpacks/graalvm:jdk" from cache
[creator] Restoring data for "paketo-buildpacks/native-image:native-image" from cache
[creator] ===> BUILDING
[creator]
[creator] Paketo CA Certificates Buildpack 2.4.2
[creator] https://github.com/paketo-buildpacks/ca-certificates
[creator] Launch Helper: Reusing cached layer
[creator]
[creator] Paketo GraalVM Buildpack 6.7.0
[creator] https://github.com/paketo-buildpacks/graalvm
[creator] Build Configuration:
[creator] $BP_JVM_VERSION 17.* 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] GraalVM JDK 17.0.1: Reusing cached layer
[creator]
[creator] Paketo Executable JAR Buildpack 5.3.1
[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 4.7.0
[creator] https://github.com/paketo-buildpacks/spring-boot
[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]
[creator] Paketo Native Image Buildpack 4.3.2
[creator] https://github.com/paketo-buildpacks/native-image
[creator] Build Configuration:
[creator] $BP_NATIVE_IMAGE true enable native image build
[creator] $BP_NATIVE_IMAGE_BUILD_ARGUMENTS arguments to pass to the native-image command
[creator] Native Image: Contributing to layer
[creator] GraalVM 21.3.0 Java 17 CE (Java Version 17.0.1+12-jvmci-21.3-b05)
[creator] Executing native-image -H:+StaticExecutableWithDynamicLibC -H:Name=/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication -cp /wor
kspace:/workspace/BOOT-INF/classes:/workspace/BOOT-INF/lib/spring-native-0.11.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/tomcat-embed-programmatic-9.0.54.jar:/workspace/BOOT-INF/lib/spring-security-we
b-5.6.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/spring-security-config-5.6.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/spring-webmvc-5.3.13.jar:/workspace/BOOT-INF/lib/spring-web-5.3.13.jar:/workspace/BOO
T-INF/lib/spring-boot-actuator-autoconfigure-2.6.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/micrometer-core-1.8.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/mongodb-driver-sync-4.4.0-beta1.jar:/workspace/BO
OT-INF/lib/spring-data-mongodb-3.3.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/tomcat-embed-el-9.0.54.jar:/workspace/BOOT-INF/lib/hibernate-validator-6.2.0.Final.jar:/workspace/BOOT-INF/lib/spring-secu
rity-core-5.6.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/spring-boot-autoconfigure-2.6.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/spring-boot-actuator-2.6.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/spring-boo
t-2.6.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/spring-context-5.3.13.jar:/workspace/BOOT-INF/lib/spring-aop-5.3.13.jar:/workspace/BOOT-INF/lib/spring-tx-5.3.13.jar:/workspace/BOOT-INF/lib/spring-dat
a-commons-2.6.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/spring-beans-5.3.13.jar:/workspace/BOOT-INF/lib/spring-expression-5.3.13.jar:/workspace/BOOT-INF/lib/spring-core-5.3.13.jar:/workspace/BOOT-INF
/lib/jakarta.annotation-api-1.3.5.jar:/workspace/BOOT-INF/lib/snakeyaml-1.29.jar:/workspace/BOOT-INF/lib/jackson-datatype-jsr310-2.13.0.jar:/workspace/BOOT-INF/lib/jackson-module-parameter-names-2
.13.0.jar:/workspace/BOOT-INF/lib/jackson-annotations-2.13.0.jar:/workspace/BOOT-INF/lib/jackson-core-2.13.0.jar:/workspace/BOOT-INF/lib/jackson-datatype-jdk8-2.13.0.jar:/workspace/BOOT-INF/lib/ja
ckson-databind-2.13.0.jar:/workspace/BOOT-INF/lib/HdrHistogram-2.1.12.jar:/workspace/BOOT-INF/lib/LatencyUtils-2.0.3.jar:/workspace/BOOT-INF/lib/mongodb-driver-core-4.4.0-beta1.jar:/workspace/BOOT
-INF/lib/bson-4.4.0-beta1.jar:/workspace/BOOT-INF/lib/logback-classic-1.2.6.jar:/workspace/BOOT-INF/lib/log4j-to-slf4j-2.14.1.jar:/workspace/BOOT-INF/lib/jul-to-slf4j-1.7.32.jar:/workspace/BOOT-IN
F/lib/slf4j-api-1.7.32.jar:/workspace/BOOT-INF/lib/jakarta.validation-api-2.0.2.jar:/workspace/BOOT-INF/lib/jboss-logging-3.4.2.Final.jar:/workspace/BOOT-INF/lib/classmate-1.5.1.jar:/workspace/BOO
T-INF/lib/spring-security-crypto-5.6.0-SNAPSHOT.jar:/workspace/BOOT-INF/lib/spring-jcl-5.3.13.jar:/workspace/BOOT-INF/lib/logback-core-1.2.6.jar:/workspace/BOOT-INF/lib/log4j-api-2.14.1.jar:/works
pace/BOOT-INF/lib/native-test-0.0.1-aot.jar de.local.test.nativetest.NativeTestApplication
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] classlist: 6,077.06 ms, 0.96 GB
[creator] 10:32:54.327 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Log4j2LoggerProvider
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] (cap): 850.27 ms, 0.96 GB
[creator] Warning: Could not register org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension: allDeclaredMethods for reflection. Reason: java.lang.NoClassDefFoundError:
reactor/core/publisher/Mono.
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] setup: 4,265.19 ms, 0.96 GB
[creator] The bundle named: org.apache.tomcat.util.threads.res.LocalStrings, has not been found. If the bundle is part of a module, verify the bundle name is a fully qualified class name.
Otherwise verify the bundle path is accessible in the classpath.
[creator] Warning: Could not register complete reflection metadata for org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension. Reason(s): java.lang.NoClassDefFoundError
: reactor/core/publisher/Mono
[creator] Warning: class initialization of class org.springframework.data.mongodb.core.ReactiveMongoOperations failed with exception java.lang.NoClassDefFoundError: org/reactivestreams/Pub
lisher. This class will be initialized at run time because option --allow-incomplete-classpath is used for image building. Use the option --initialize-at-run-time=org.springframework.data.mongodb.
core.ReactiveMongoOperations to explicitly request delayed initialization of this class.
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] (clinit): 1,600.03 ms, 5.37 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] (typeflow): 49,335.06 ms, 5.37 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] (objects): 121,395.69 ms, 5.37 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] (features): 22,715.27 ms, 5.37 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] analysis: 198,901.06 ms, 5.37 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] universe: 11,082.51 ms, 5.40 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] (parse): 12,708.32 ms, 5.12 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] (inline): 15,510.17 ms, 5.12 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] (compile): 112,341.79 ms, 5.16 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] compile: 148,888.21 ms, 5.16 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] image: 12,280.77 ms, 5.16 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] write: 1,518.91 ms, 5.16 GB
[creator] [/layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication:160] [total]: 383,494.29 ms, 5.16 GB
[creator] # Printing build artifacts to: /layers/paketo-buildpacks_native-image/native-image/de.local.test.nativetest.NativeTestApplication.build_artifacts.txt
[creator] Removing bytecode
[creator] Process types:
[creator] native-image: /workspace/de.local.test.nativetest.NativeTestApplication (direct)
[creator] task: /workspace/de.local.test.nativetest.NativeTestApplication (direct)
[creator] web: /workspace/de.local.test.nativetest.NativeTestApplication (direct)
[creator] ===> EXPORTING
[creator] Reusing layer 'paketo-buildpacks/ca-certificates:helper'
[creator] Adding 1/1 app layer(s)
[creator] Reusing layer 'launcher'
[creator] Adding layer 'config'
[creator] Reusing layer 'process-types'
[creator] Adding label 'io.buildpacks.lifecycle.metadata'
[creator] Adding label 'io.buildpacks.build.metadata'
[creator] Adding label 'io.buildpacks.project.metadata'
[creator] Adding label 'org.springframework.boot.version'
[creator] Setting default process type 'web'
[creator] Saving docker.markant.com/native-test:0.0.1...
[creator] *** Images (500023fee401):
[creator] docker.markant.com/native-test:0.0.1
[creator] Reusing cache layer 'paketo-buildpacks/graalvm:jdk'
[creator] Adding cache layer 'paketo-buildpacks/native-image:native-image'
`
build.gradle:
plugins {
id 'org.springframework.boot' version '2.6.0-SNAPSHOT'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'org.springframework.experimental.aot' version '0.11.0-SNAPSHOT'
}
group = 'de.local.test'
version = '0.0.1'
sourceCompatibility = '17'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/snapshot' }
maven { url 'https://repo.spring.io/milestone' }
}
dependencies {
implementation('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'org.apache.tomcat.embed', module: 'tomcat-embed-core'
exclude group: 'org.apache.tomcat.embed', module: 'tomcat-embed-websocket'
}
implementation "org.apache.tomcat.experimental:tomcat-embed-programmatic:${dependencyManagement.importedProperties["tomcat.version"]}"
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.security:spring-security-web'
implementation 'org.springframework.security:spring-security-config'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.boot:spring-security-test'
}
test {
useJUnitPlatform()
}
bootBuildImage {
builder = 'paketobuildpacks/builder:tiny'
runImage = 'paketobuildpacks/run:tiny-cnb'
imageName = "docker.private.com/${project.name}:${project.version}"
environment = ['BP_NATIVE_IMAGE': 'true']
}
Any idea why its failing since this morning?
Thanks
Activity
Fix LinkedHashSet.<init>() method not found error