spring-attic / spring-native

Spring Native is now superseded by Spring Boot 3 official native support
https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html
Apache License 2.0
2.74k stars 356 forks source link

ApplicationServletEnvironment class not found in spring-aot-0.12.1 AotApplicationContextFactory #1745

Closed oeresundsgruppen closed 1 year ago

oeresundsgruppen commented 1 year ago

ApplicationServletEnvironment class not found in spring-aot-0.12.1 AotApplicationContextFactory

[INFO] --- spring-aot-maven-plugin:0.12.1:generate (generate) @ webWith --- Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/ApplicationServletEnvironment at org.springframework.boot.AotApplicationContextFactory.getOrCreateEnvironment(AotApplicationContextFactory.java:80) at org.springframework.boot.AotApplicationContextFactory.loadEnvironment(AotApplicationContextFactory.java:61) at org.springframework.boot.AotApplicationContextFactory.createApplicationContext(AotApplicationContextFactory.java:52) at org.springframework.aot.build.ContextBootstrapContributor.contribute(ContextBootstrapContributor.java:76) at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:91) at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:71) at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:107) at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:42) at picocli.CommandLine.executeUserObject(CommandLine.java:1953) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2346) at picocli.CommandLine$RunLast.handle(CommandLine.java:2311) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine.execute(CommandLine.java:2078) at org.springframework.aot.build.GenerateBootstrapCommand.main(GenerateBootstrapCommand.java:112)

wangliang181230 commented 1 year ago

https://github.com/spring-projects-experimental/spring-native/issues/1740

sdeleuze commented 1 year ago

Spring Native is now superseded by Spring Boot 3 official native support, see the related reference documentation for more details.

As a consequence, I am closing this issue, and recommend trying your use case with latest Spring Boot 3 version. If you still experience the issue reported here, please open an issue directly on the related Spring project (Spring Framework, Data, Security, Boot, Cloud, etc.) with a reproducer.

Thanks for your contribution on the experimental Spring Native project, we hope you will enjoy the official native support introduced by Spring Boot 3.