Skip to content

Unaccessible module errors #3

Description

@dbt-lucka

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions