Java 9模块{Spring}模块的Spring Security消息源错误

时间:2018-03-24 10:19:06

标签: spring spring-boot spring-security java-9

我正在尝试使用Java 9模块和Spring框架编写模块化的Java Web应用程序。我正在使用Spring Boot 2.0来完成这项任务。在将Spring Security添加到项目之前,一切似乎都运行良好。当我添加Spring Security时,我开始收到多条带有消息的异常:java.lang.UnsupportedOperationException: ResourceBundle.Control not supported in named modules。无论我是定义一个消息源bean还是将所有内容保留为默认值,都会发生错误。

我已经放置了可以在GitHub上复制此错误的示例源代码: https://github.com/ankalag0n/SpringSecurityJ9Test

我做错了什么或Spring Security还不支持Java 9吗?

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]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:138) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.4.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.4.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.4.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.4.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.security.web@5.0.3.RELEASE/org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.0.3.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) ~[spring-web-5.0.4.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) ~[spring-web-5.0.4.RELEASE.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.28.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.4.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.4.RELEASE.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.28.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.4.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.4.RELEASE.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.28.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-5.0.4.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.4.RELEASE.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.28.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.0.4.RELEASE.jar:na]
    at spring.web@5.0.4.RELEASE/org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.4.RELEASE.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) ~[tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.28.jar:na]
    at tomcat.embed.core@8.5.28/org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.28.jar:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) [na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) [na:na]
    at tomcat.embed.core@8.5.28/org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.28.jar:na]
    at java.base/java.lang.Thread.run(Thread.java:844) [na:na]

0 个答案:

没有答案