You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using Spring Boot 3.0.0-M5 to build a native application with the ./mvnw -Pnative package and the auth.jdbcAuthentication().withDefaultSchema() option set on the JdbcUserDetailsManagerConfigurer, the application is compiled as native application but gives a runtime exception.
The exception is: Caused by: java.io.FileNotFoundException: class path resource [org/springframework/security/core/userdetails/jdbc/users.ddl] cannot be opened because it does not exist
Leaving out the .withDefaultSchema() part, the application is starting without issues.
To Reproduce
Start a Spring Boot 3.0.0-M5 application and include the Spring Security module.
Add a Bean configuration which returns the UserDetailsManger created from the AuthenticationManagerBuilder. Set it with: return auth.jdbcAuthentication().withDefaultSchema().getUserDetailsService()
Expected behavior
The application should start with loading the default schema, into the datasource given, when configured using the .withDefaultSchema() option.
marcusdacoregio
changed the title
Native application fails to start when using JdbcUserDetailsManagerConfigurer withDefaultSchema
Add native hint for the default JDBC schema
Sep 29, 2022
Describe the bug
When using Spring Boot 3.0.0-M5 to build a native application with the
./mvnw -Pnative package
and theauth.jdbcAuthentication().withDefaultSchema()
option set on theJdbcUserDetailsManagerConfigurer
, the application is compiled as native application but gives a runtime exception.The exception is:
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/security/core/userdetails/jdbc/users.ddl] cannot be opened because it does not exist
This seems to be related to the https://github.com/spring-projects/spring-security/blob/main/core/src/main/java/org/springframework/security/aot/hint/CoreSecurityRuntimeHints.java which is missing the DDL schema as resource. This causes GraalVM to not include the DDL schema when building the native application.
Leaving out the
.withDefaultSchema()
part, the application is starting without issues.To Reproduce
Start a Spring Boot 3.0.0-M5 application and include the Spring Security module.
Add a Bean configuration which returns the UserDetailsManger created from the AuthenticationManagerBuilder. Set it with:
return auth.jdbcAuthentication().withDefaultSchema().getUserDetailsService()
Expected behavior
The application should start with loading the default schema, into the datasource given, when configured using the
.withDefaultSchema()
option.Sample
https://github.com/willemvd/jdbc-security-default-schema-native
The text was updated successfully, but these errors were encountered: