Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unaccessible module errors #3

Open
dbt-lucka opened this issue Nov 29, 2023 · 0 comments
Open

Unaccessible module errors #3

dbt-lucka opened this issue Nov 29, 2023 · 0 comments

Comments

@dbt-lucka
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant