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

O365Interactive access does not work on latest Ubuntu with OpenJDK 21 #364

Open
miklcct opened this issue Aug 12, 2024 · 2 comments
Open

Comments

@miklcct
Copy link

miklcct commented Aug 12, 2024

Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: superclass access check failed: class davmail.exchange.auth.O365InteractiveAuthenticatorFrame$2 (in unnamed module @0x5b8bc155) cannot access class sun.net.www.protocol.https.Handler (in module java.base) because module java.base does not export sun.net.www.protocol.https to unnamed module @0x5b8bc155
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at davmail.exchange.auth.O365InteractiveAuthenticator.lambda$authenticate$0(O365InteractiveAuthenticator.java:150)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

It works with OpenJDK 11 but not 17 or 21.

@esabol
Copy link

esabol commented Aug 13, 2024

@miklcct : I think this is a duplicate of issue #344. Read that issue for details, but one thing you can try is adding --add-exports java.base/sun.net.www.protocol.https=ALL-UNNAMED to the java command in the script used to start DavMail or use the "azul" argument to DavMail to download and use the Azul JDK. Make sure you're using the latest release of DavMail.

@mguessan
Copy link
Owner

With JDK 17 and 21 you need to have OpenJFX installed in addition to basic JDK.

I recently (last april) added the following code do davmail launch script:

  elif [ -e "/usr/share/openjfx" ]; then
    # matches Kubuntu
    echo "Enable OpenJFX"
    JAVA_OPTS="$JAVA_OPTS --add-exports java.base/sun.net.www.protocol.https=ALL-UNNAMED"

Do you have openjfx available in /usr/share/openjfx?

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

3 participants