Springboot 4.0.0-M1 и Graalvm aot java.lang.classnotfoundexception: org.springframework.boot.http.client.clienthttprequeJAVA

Программисты JAVA общаются здесь
Anonymous
Springboot 4.0.0-M1 и Graalvm aot java.lang.classnotfoundexception: org.springframework.boot.http.client.clienthttpreque

Сообщение Anonymous »

Я хотел бы создать нативное изображение с недавно выпущенным (на момент написания этой статьи) Spring Boot 4.0.0-M1 и Graalvm AOT < /p>
С этим кодом: < /p>

Код: Выделить всё

 & l t ; p r o j e c t   x m l n s : x s i = & q u o t ; h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e & q u o t ; < b r   / >                   x m l n s = & q u o t ; h t t p : / / m a v e n . a p a c h e . o r g / P O M / 4 . 0 . 0 & q u o t ; < b r   / >                   x s i : s c h e m a L o c a t i o n = & q u o t ; h t t p : / / m a v e n . a p a c h e . o r g / P O M / 4 . 0 . 0   h t t p : / / m a v e n . a p a c h e . o r g / x s d / m a v e n - 4 . 0 . 0 . x s d & q u o t ; & g t ; < b r   / >         & l t ; m o d e l V e r s i o n & g t ; 4 . 0 . 0 & l t ; / m o d e l V e r s i o n & g t ; < b r   / > < b r   / >         & l t ; p a r e n t & g t ; < b r   / >                 & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r   / >                 & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - p a r e n t & l t ; / a r t i f a c t I d & g t ; < b r   / >                 & l t ; v e r s i o n & g t ; 4 . 0 . 0 - M 1 & l t ; / v e r s i o n & g t ; < b r   / >                 & l t ; r e l a t i v e P a t h / & g t ; < b r   / >         & l t ; / p a r e n t & g t ; < b r   / > < b r   / >         & l t ; g r o u p I d & g t ; c o m . e x a m p l e & lt;/groupId>
aotissue
1.1


24




org.springframework.boot
spring-boot-starter-webflux


org.springframework.boot
spring-boot-kafka


org.springframework.boot
spring-boot-opentelemetry



org.springframework.boot
spring-boot-starter-actuator


io.projectreactor
reactor-core-micrometer


io.opentelemetry
opentelemetry-exporter-otlp


io.micrometer
micrometer-tracing-bridge-otel


io.micrometer
micrometer-registry-otlp



io.projectreactor.kafka
reactor-kafka
1.3.23


org.springframework.cloud
spring-cloud-function-context
4.3.0


com.github.loki4j
loki-logback-appender
2.0.0






org.springframework.boot
spring-boot-maven-plugin



24





org.graalvm.buildtools
native-maven-plugin






spring-milestones
Spring Milestones
https://repo.spring.io/milestone

false



confluent
https://packages.confluent.io/maven/




spring-milestones
Spring Milestones
https://repo.spring.io/milestone

false






< /code>
@SpringBootApplication
public class QuestionApplication {

public static void main(final String[] args)  {
SpringApplication.run(QuestionApplication.class);
}

}

< /code>
It will always result in:
[           main] [                                                 ] c.QuestionApplication        : No active profile set, falling back to 1 default profile: "default"
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/http/client/ClientHttpRequestFactorySettings
at org.springframework.cloud.function.context.FunctionTypeProcessor$ReflectiveProcessorBeanFactoryInitializationAotContribution.applyTo(FunctionTypeProcessor.java:114)
at org.springframework.context.aot.BeanFactoryInitializationAotContributions.applyTo(BeanFactoryInitializationAotContributions.java:94)
at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:59)
at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:68)
at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:54)
at org.springframework.context.aot.ContextAotProcessor.performAotProcessing(ContextAotProcessor.java:107)
at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:84)
at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:49)
at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:84)
at org.springframework.boot.SpringApplicationAotProcessor.main(SpringApplicationAotProcessor.java:80)
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.http.client.ClientHttpRequestFactorySettings
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
... 10 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
< /code>
mvn -U -Pnative spring-boot:build-image -DskipTests
< /code>
With version 3.5.3, this would compile fine
With version 4.0.0-M1, it will always yield java.lang.ClassNotFoundException: org.springframework.boot.http.client.ClientHttpRequestFactorySettings

Как исправить эту проблему, чтобы нативное изображение было построено?

Подробнее здесь: https://stackoverflow.com/questions/797 ... org-spring

Вернуться в «JAVA»