Skip to content

Warnings when running a GUI testcase #274

Description

@RSHKwee

When I run a Swing test, I get during the test run the following messages:
...
jul. 18,2023 08:12 WARNING Exception thrown by a TimerTask org.assertj.swing.monitor.ProtectingTimerTask ; handleException
jul. 18,2023 08:12 WARNING Exception thrown by a TimerTask org.assertj.swing.monitor.ProtectingTimerTask ; handleException
jul. 18,2023 08:12 WARNING Exception thrown by a TimerTask org.assertj.swing.monitor.ProtectingTimerTask ; handleException
jul. 18,2023 08:12 WARNING Exception thrown by a TimerTask org.assertj.swing.monitor.ProtectingTimerTask ; handleException
jul. 18,2023 08:12 WARNING Exception thrown by a TimerTask org.assertj.swing.monitor.ProtectingTimerTask ; handleException
jul. 18,2023 08:12 WARNING Exception thrown by a TimerTask org.assertj.swing.monitor.ProtectingTimerTask ; handleException
jul. 18,2023 08:12 WARNING Exception thrown by a TimerTask org.assertj.swing.monitor.ProtectingTimerTask ; handleException
jul. 18,2023 08:12 WARNING Exception thrown by a TimerTask org.assertj.swing.monitor.ProtectingTimerTask ; handleException
jul. 18,2023 08:12 WARNING Exception thrown by a TimerTask org.assertj.swing.monitor.ProtectingTimerTask ; handleException
...

Which timer can I increase to limit the messages?
And how do I do it?

Activity

  1. arduhe commented on Aug 20, 2023

    @arduhe

    Have the same problem, but I don't think that this is a matter of increasing timer limits. Problem occured after switching from JDK 11 to JDK 17 and has a stacktrace which shows an access to a module inside java.util

    Aug. 20, 2023 9:49:38 AM org.assertj.swing.monitor.ProtectingTimerTask handleException
    WARNUNG: Exception thrown by a TimerTask
    java.lang.reflect.InaccessibleObjectException: Unable to make field int java.util.TimerTask.state accessible: module java.base does not "opens java.util" to unnamed module @6c38726a
            at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
            at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
            at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
            at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
            at org.assertj.swing.dependency.fest_reflect.util.Accessibles$SetAccessibleAction.run(Accessibles.java:70)
            at org.assertj.swing.dependency.fest_reflect.util.Accessibles$SetAccessibleAction.run(Accessibles.java:60)
            at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
            at org.assertj.swing.dependency.fest_reflect.util.Accessibles.setAccessible(Accessibles.java:57)
            at org.assertj.swing.dependency.fest_reflect.util.Accessibles.makeAccessible(Accessibles.java:46)
            at org.assertj.swing.dependency.fest_reflect.field.Invoker.verifyCorrectType(Invoker.java:98)
            at org.assertj.swing.dependency.fest_reflect.field.Invoker.createInvoker(Invoker.java:74)
            at org.assertj.swing.dependency.fest_reflect.field.Invoker.newInvoker(Invoker.java:68)
            at org.assertj.swing.dependency.fest_reflect.field.FieldType.in(FieldType.java:74)
            at org.assertj.swing.monitor.ProtectingTimerTask.isCanceled(ProtectingTimerTask.java:54)
            at org.assertj.swing.monitor.ProtectingTimerTask.run(ProtectingTimerTask.java:41)
            at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
            at java.base/java.util.TimerThread.run(Timer.java:516)
    
    
  2. Gambit2505 commented on Feb 27, 2026

    @Gambit2505

    Sorry to bring this back up, but for anyone else still having this problem, I was able to semi-permanently fix it by adding the following argument to the VM (jre 21):

    --add-opens java.base/java.util=ALL-UNNAMED
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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