尝试在处理中绘制图形时发生捕获的异常

时间:2018-06-20 15:08:15

标签: raspberry-pi processing runtimeexception

在处理树莓派时,我试图弹出第二个屏幕,其中包含我以另一种方法收集的数据。在短期内(大约1分钟或更短的时间),代码可以毫无问题地做到这一点。如果运行时间较长(超过1分钟),则会弹出此错误消息:

RunnableTask.run(): A caught exception occured on thread Animation Thread-Display-.x11_:0.0-2-EDT-1: RunnableTask[enqueued true[executed false, flushed false], tTotal 0 ms, tExec 0 ms, tQueue 0 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: <127debe, 14323ef>[count 1, qsz 0, owner <Animation Thread-FPSAWTAnimator#00-Timer0>] - <Animation Thread-Display-.x11_:0.0-2-EDT-1>] java.lang.RuntimeException: Waited 5000ms for: <127debe, 14323ef>[count 1, qsz 0, owner <Animation Thread-FPSAWTAnimator#00-Timer0>] - <Animation Thread-Display-.x11_:0.0-2-EDT-1> at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198) at jogamp.newt.WindowImpl.getLocationOnScreen(WindowImpl.java:1159) at jogamp.newt.driver.x11.X11UnderlayTracker.windowMoved(X11UnderlayTracker.java:141) at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4386) at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4317) at jogamp.newt.WindowImpl.positionChanged(WindowImpl.java:4558) at jogamp.newt.WindowImpl.sizePosMaxInsetsVisibleChanged(WindowImpl.java:4865) at jogamp.newt.driver.x11.DisplayDriver.DispatchMessages0(Native Method) at jogamp.newt.driver.x11.DisplayDriver.dispatchMessagesNative(DisplayDriver.java:112) at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4449) at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4443) at jogamp.newt.WindowImpl.createNative(WindowImpl.java:777) at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1248) at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1318) at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:127) at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375) DefaultEDT.run(): Caught exception occured on thread Animation Thread-Display-.x11_:0.0-2-EDT-1: RunnableTask[enqueued false[executed true, flushed false], tTotal 8481 ms, tExec 8481 ms, tQueue 0 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: <127debe, 14323ef>[count 1, qsz 0, owner <Animation Thread-FPSAWTAnimator#00-Timer0>] - <Animation Thread-Display-.x11_:0.0-2-EDT-1>] java.lang.RuntimeException: Waited 5000ms for: <127debe, 14323ef>[count 1, qsz 0, owner <Animation Thread-FPSAWTAnimator#00-Timer0>] - <Animation Thread-Display-.x11_:0.0-2-EDT-1> at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198) at jogamp.newt.WindowImpl.getLocationOnScreen(WindowImpl.java:1159) at jogamp.newt.driver.x11.X11UnderlayTracker.windowMoved(X11UnderlayTracker.java:141) at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:4386) at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:4317) at jogamp.newt.WindowImpl.positionChanged(WindowImpl.java:4558) at jogamp.newt.WindowImpl.sizePosMaxInsetsVisibleChanged(WindowImpl.java:4865) at jogamp.newt.driver.x11.DisplayDriver.DispatchMessages0(Native Method) at jogamp.newt.driver.x11.DisplayDriver.dispatchMessagesNative(DisplayDriver.java:112) at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4449) at jogamp.newt.WindowImpl.waitForVisible(WindowImpl.java:4443) at jogamp.newt.WindowImpl.createNative(WindowImpl.java:777) at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1248) at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1318) at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:127) at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375)

显示此消息后,它确实对数据进行了图形化处理,但是我不知道为什么会发生此错误。很抱歉,我对编码仍然很陌生,对此我还是很陌生。如果您对这种情况的发生方式或原因有任何想法,以及任何可能的修复方法,将不胜感激。可以找到我的完整代码here,尽管我认为该错误来自“ Second_Screen”文件,但为防万一,我将整个代码包括在内。再次感谢您的帮助,非常感谢!

如果您需要任何其他信息,请告诉我!抱歉,如果我忘记了任何必要的话。

1 个答案:

答案 0 :(得分:0)

在“第二屏幕文件”中,使用以下行:

window2 = GWindow.getWindow(this, "Window title", 25, 25, 855, 510, P2D);

通过将其更改为

window2 = GWindow.getWindow(this, "Window title", 25, 25, 855, 510, JAVA2D);

在我进行越来越长时间的测试时,该错误已解决,但尚未出现任何错误。我不确定JAVA2D和P2D之间的区别,但这并不重要,因为我很高兴错误已解决。