When starting the application you get this error:
Caused by: java.lang.IllegalAccessError: superclass access check failed: class org.springframework.security.oauth.consumer.net.OAuthOverHttpURLStreamHandler (in unnamed module @0x17579e0f) cannot access class sun.net.www.protocol.http.Handler (in module java.base) because module java.base does not export sun.net.www.protocol.http to unnamed module @0x17579e0f
The error arises out of OAuthURLStreamHandlerFactory from Spring Security for OAuth 1 (deprecated)
The cause is since the Java 9 module system, certain JDK internal APIs are strongly encapsulated for security reasons.
Since OAuth 1 is deprecated anyway, the only reasonable action is to workaround this issue for this demo, by applying these VM args to gain access to the protected JDK modules:
--add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED
--add-exports java.base/sun.net.www.protocol.https=ALL-UNNAMED
When starting the application you get this error:
The error arises out of
OAuthURLStreamHandlerFactoryfrom Spring Security for OAuth 1 (deprecated)The cause is since the Java 9 module system, certain JDK internal APIs are strongly encapsulated for security reasons.
Since OAuth 1 is deprecated anyway, the only reasonable action is to workaround this issue for this demo, by applying these VM args to gain access to the protected JDK modules: