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 355 forks source link

Native reflection configuration for org.eclipse.jetty.security.ConstraintSecurityHandler.<init>() is missing #1586

Closed ebremer closed 2 years ago

ebremer commented 2 years ago

Project builds under Ubuntu 20, but on startup, I get the following:

Spring Boot Version:  (v2.6.6)
Keycloak Version: (v@keycloak.version@)

2022-04-14 10:56:35.238  INFO 16862 --- [           main] c.g.t.keycloak.embedded.runner.Main      : Starting Main v999-SNAPSHOT using Java 17.0.3 on Corsair with PID 16862 (/mnt/d/projects/embedded-spring-boot-keycloak-server/embedded-keycloak-server-plain/target/keycloak started by erich in /mnt/d/projects/embedded-spring-boot-keycloak-server/embedded-keycloak-server-plain)
2022-04-14 10:56:35.238  INFO 16862 --- [           main] c.g.t.keycloak.embedded.runner.Main      : No active profile set, falling back to 1 default profile: "default"
2022-04-14 10:56:35.335:INFO::main: Logging initialized @1104ms to org.eclipse.jetty.util.log.StdErrLog
2022-04-14 10:56:35.383  WARN 16862 --- [           main] w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.IllegalStateException: java.lang.NoSuchMethodException: org.eclipse.jetty.security.ConstraintSecurityHandler.<init>()
2022-04-14 10:56:35.384 ERROR 16862 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Native reflection configuration for org.eclipse.jetty.security.ConstraintSecurityHandler.<init>() is missing.

It can be reproduced with:

git clone https://github.com/ebremer/embedded-spring-boot-keycloak-server.git
cd embedded-spring-boot-keycloak-server
git checkout nativebuild
mvn -X -DskipTests -Pjetty clean install
cd embedded-keycloak-server-plain
target/keycloak

This project is an updated version of #1576 but has been updated to also do Jetty-based builds (it will still produce the error for #1576 for undertow builds)

sdeleuze commented 2 years ago

Yeah this is expected, only Tomcat is supported for now, see #249 related issue and support documentation.

This should probably fixed in Spring Boot 3 timeframe, so I will close this issue as duplicate of #249.