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

IllegalAccessError crash on macOS #207

Open
Nohus opened this issue Jan 25, 2024 · 5 comments
Open

IllegalAccessError crash on macOS #207

Nohus opened this issue Jan 25, 2024 · 5 comments

Comments

@Nohus
Copy link
Contributor

Nohus commented Jan 25, 2024

System information:
macOS 12.7.2 x86_64

Stack trace:

java.lang.IllegalAccessError: class java.awt.MenuComponentAccessory tried to access private field java.awt.TrayIcon.peer (java.awt.MenuComponentAccessory and java.awt.TrayIcon are in module java.desktop of loader 'bootstrap')
    at java.awt.MenuComponentAccessory.getLocation(MenuComponentAccessory.java)
    at dorkbox.systemTray.util.AwtAccessor.getLocation(AwtAccessor.java)
    at dorkbox.systemTray.ui.osx._OsxAwtTray$1$1.mouseClicked(_OsxAwtTray.java:174)
    at java.awt.TrayIcon.processMouseEvent(TrayIcon.java:771)
    at java.awt.TrayIcon.processEvent(TrayIcon.java:745)
    at java.awt.TrayIcon.dispatchEvent(TrayIcon.java:736)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.awt.EventQueue$4.run(EventQueue.java:716)
    at java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.awt.EventQueue$5.run(EventQueue.java:746)
    at java.awt.EventQueue$5.run(EventQueue.java:744)
    at java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Logs:

image

@Nohus
Copy link
Contributor Author

Nohus commented Jan 25, 2024

The solution seems to be to not try accessing peer if we failed to make it public previously.

@dorkbox
Copy link
Owner

dorkbox commented Feb 14, 2024

I’ll look into that. Thanks!

@dorkbox
Copy link
Owner

dorkbox commented Feb 14, 2024

Also, can you send me the java version, and how you’re running it?

Also with SystemTray.DEBUG = true ?

I develop and test this on MacOS (13 and 14), so it should work without issues, and I’m likely missing something for version 12.

@Nohus
Copy link
Contributor Author

Nohus commented Feb 14, 2024

Here are the versions it happens on:
image

I haven't managed to reproduce it myself, I only have crash reports from users. It doesn't look specific to MacOS 12.

@dorkbox
Copy link
Owner

dorkbox commented Feb 14, 2024

Interesting. I will check this out with oracle’s runtime - they might have moved stuff around.

I tested just now with temurin and it’s working as expected

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

2 participants