spring-projects / spring-projects/spring-security

Spring security web in java 9 named module

Open
#5,069 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Summary

I am trying to run a spring-boot app with spring-security WebSecurityConfigurerAdapter in named module (Java 9) and getting exception
java.lang.UnsupportedOperationException: ResourceBundle.Control not supported in named modules at java.base/java.util.ResourceBundle.checkNamedModule(ResourceBundle.java:1537) ~[na:na] at java.base/java.util.ResourceBundle.getBundle(ResourceBundle.java:1498) ~[na:na] at spring.context@5.0.4.RELEASE/org.springframework.context.support.ResourceBundleMessageSource.doGetBundle(ResourceBundleMessageSource.java:223) ~[spring-context-5.0.4.RELEASE.jar:na] at spring.context@5.0.4.RELEASE/org.springframework.context.support.ResourceBundleMessageSource.getResourceBundle(ResourceBundleMessageSource.java:189) ~[spring-context-5.0.4.RELEASE.jar:na] at spring.context@5.0.4.RELEASE/org.springframework.context.support.ResourceBundleMessageSource.resolveCodeWithoutArguments(ResourceBundleMessageSource.java:132) ~[spring-context-5.0.4.RELEASE.jar:na] at spring.context@5.0.4.RELEASE/org.springframework.context.support.AbstractMessageSource.getMessageInternal(AbstractMessageSource.java:212) ~[spring-context-5.0.4.RELEASE.jar:na] at spring.context@5.0.4.RELEASE/org.springframework.context.support.AbstractMessageSource.getMessage(AbstractMessageSource.java:141) ~[spring-context-5.0.4.RELEASE.jar:na] at spring.context@5.0.4.RELEASE/org.springframework.context.support.MessageSourceAccessor.getMessage(MessageSourceAccessor.java:87) ~[spring-context-5.0.4.RELEASE.jar:na] at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.access.ExceptionTranslationFilter.handleSpringSecurityException(ExceptionTranslationFilter.java:187) ~[spring-security-web-5.0.3.RELEASE.jar:na]

Are there plans to support spring-security to work in named Java 9 module?
I use spring security 5.0.3.RELEASE with Spring Boot 2.0.0.RELEASE.

My WebSecurityConfigurerAdapter is
`

@Bean
public PasswordEncoder encoder() {
    return new BCryptPasswordEncoder();
}

@Override
public void configure(final HttpSecurity http) throws Exception {
    http.antMatcher("/**").authorizeRequests().anyRequest().authenticated();
}

`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Java 9 named-module setup and the ResourceBundle.Control exception in the stack trace, then inspect ResourceBundleMessageSource and WebSecurityConfigurerAdapter usage. Reproduce the failure with Spring Security 5.0.3 and Spring Boot 2.0.0; done means the application can use the shown security configuration without the named-module exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.