-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Leonardo Zanivan opened SPR-16776 and commented
ResourceBundleMessageSource broken when using Java 9 module system.
Using a custom ResourceBundle.Control isn't supported by Java 9 Module system.
Strack trace:
java.lang.UnsupportedOperationException: ResourceBundle.Control not supported in named modulesjava.lang.UnsupportedOperationException: ResourceBundle.Control not supported in named modules at java.base/java.util.ResourceBundle.checkNamedModule(ResourceBundle.java:1547) at java.base/java.util.ResourceBundle.getBundle(ResourceBundle.java:1508) at spring.context@5.0.5.RELEASE/org.springframework.context.support.ResourceBundleMessageSource.doGetBundle(ResourceBundleMessageSource.java:223) at spring.context@5.0.5.RELEASE/org.springframework.context.support.ResourceBundleMessageSource.getResourceBundle(ResourceBundleMessageSource.java:189) at spring.context@5.0.5.RELEASE/org.springframework.context.support.ResourceBundleMessageSource.resolveCodeWithoutArguments(ResourceBundleMessageSource.java:132) at spring.context@5.0.5.RELEASE/org.springframework.context.support.AbstractMessageSource.getMessageInternal(AbstractMessageSource.java:212) at spring.context@5.0.5.RELEASE/org.springframework.context.support.AbstractMessageSource.getMessage(AbstractMessageSource.java:169) at spring.context@5.0.5.RELEASE/org.springframework.context.support.AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1276) at spring.webmvc@5.0.5.RELEASE/org.springframework.web.servlet.support.RequestContext.getMessage(RequestContext.java:725)The error is caused by the following line which is using a custom ResourceBundle.Control.
Steps to reproduce:
Petclinic is the sample ported application to Spring Boot 2.0.1 and Java 9 module system.
- Clone:
https://github.com/panga/spring-petclinic-java9modules
- Build with JDK 10:
mvn clean package- Run application with module-path:
mvn exec:execNote: mvn spring-boot:run goal will execute in classpath mode, thus the erros doesn't happen.
- Open browser with url:
http://localhost:8080/owners?lastName=test
- Verify the stack trace in the console.
Affects: 5.0.5
Issue Links:
- ResourceBundleMessageSource should allow for custom PropertyResourceBundle subclass [SPR-12666] #17265 ResourceBundleMessageSource should allow for custom PropertyResourceBundle subclass
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug