# A caught error exception occurred on Raspberry Pi

**URL:** <https://discourse.processing.org/t/a-caught-error-exception-occurred-on-raspberry-pi/1129>\
**Category:** Coding Questions\
**Created:** [June 20, 2018, 6:08pm UTC](https://discourse.processing.org/t/a-caught-error-exception-occurred-on-raspberry-pi/1129 "2018-06-20T18:08:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samsanit](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Samsanit](https://discourse.processing.org/u/Samsanit)\
**Post date:** [June 20, 2018, 6:08pm UTC](https://discourse.processing.org/t/a-caught-error-exception-occurred-on-raspberry-pi/1129/1 "2018-06-20T18:08:50Z")

</div>

Hi, while working with processing on raspberry pi I was attempting to have a second screen pop up with data I had gathered in a separate method. On short runs (about 1 minute or less), the code is able to make this without issue. On longer runs (above 1 minute) it pops up this error message in the console:

> 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\>] - ]  
> java.lang.RuntimeException: Waited 5000ms for: \<127debe, 14323ef\>[count 1, qsz 0, owner \<Animation Thread-FPSAWTAnimator#00-Timer0\>] -   
> 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\>] - ]  
> java.lang.RuntimeException: Waited 5000ms for: \<127debe, 14323ef\>[count 1, qsz 0, owner \<Animation Thread-FPSAWTAnimator#00-Timer0\>] -   
> 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)

After displaying this error it does end up graphing the G4P window without issue which is very weird. If anyone has any ideas on what this error could be, or any possible fixes I would greatly appreciate it. I’m sorry if this is a stupid question I don’t have a ton of experience coding 😅

My full code can be found here: [Dropbox - Data\_Baseline - Simplify your life](https://www.dropbox.com/sh/fw4lzk7to77xu2w/AACrpVnWW4Jq9MFzKa5uzLEfa?dl=0)

The error I believe is coming from the “Second\_Screen” file, though the whole code is included just in case. Please let me know if you need any additional information, as I’m more than happy to provide it. Thanks again for any help that you can give 😀

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 21, 2018, 12:40am UTC](https://discourse.processing.org/t/a-caught-error-exception-occurred-on-raspberry-pi/1129/2 "2018-06-21T00:40:36Z")

</div>

If you post to multiple websites, please link between crossposts. This question already has an answer here:

> <https://stackoverflow.com/questions/50951468/a-caught-exception-occurred-while-trying-to-draw-a-graph-in-processing>

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [June 22, 2018, 9:18am UTC](https://discourse.processing.org/t/a-caught-error-exception-occurred-on-raspberry-pi/1129/3 "2018-06-22T09:18:03Z")

</div>

> [@Samsanit](#):
>
> Waited 5000ms for

This above is in your error message. It looks like you are holding the main thread in one of your functions. Sorry, no time to check all your source code. You should post the relevant code here or make an mcve.

Now, if after displaying the error and the program displays the graphs, does it continue working normally? If so, I would treat the above as a warning. If I were in your shoes, I would fix it only if it creates some undesirable behavior in my code.

Kf

---

<div class="post-metadata">

**Author:** ![Samsanit](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Samsanit](https://discourse.processing.org/u/Samsanit)\
**Post date:** [June 22, 2018, 4:02pm UTC](https://discourse.processing.org/t/a-caught-error-exception-occurred-on-raspberry-pi/1129/4 "2018-06-22T16:02:15Z")

</div>

Hi kfrajer Thank you for the response! In the stack overflow question I found some way to disable the error message. It didn’t change anything functionally, but I just didn’t want to see the error message. The link to the solution can be found here: [https://stackoverflow.com/questions/50951468/a-caught-exception-occurred-while-trying-to-draw-a-graph-in-processing](https://stackoverflow.com/questions/50951468/a-caught-exception-occurred-while-trying-to-draw-a-graph-in-processing). Kind of a weird solution and I’m not sure how it works, but the error message is gone so I’m happy. Thanks again for the help though!

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [June 22, 2018, 9:02pm UTC](https://discourse.processing.org/t/a-caught-error-exception-occurred-on-raspberry-pi/1129/5 "2018-06-22T21:02:05Z")

</div>

Thank you for sharing your solution. From limited experience I believe the error is because you are trying to access the OpenGL renderer a second time while it has been taken by your main window. JAVA2D is the default renderer in Processing. These two statements are the same: `size(400,600)` and `size(400,600,JAVA2D)`. When you use this renderer, all the graphics calculations are done by the CPU. Therefore, if you have lots of graphical operations, your sketch will lag. On the other hand, if you use `size(400,600,P3D)` (or P2D), you are using the OpenGL channel to process your graphics operations, which uses your computer’s GPU to accomplish these tasks. In essence, graphical operations experience better performance when compared to the default renderer. As a note, there is a third renderer available in P3, `FX2D` which is faster than JAVA2D at a cost of less graphics details.

In your case, only one sketch is allowed to use the P3D renderer. Any other sketch should use the JAVA2D.

Kf

---

<div class="post-metadata">

**Author:** ![Samsanit](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@Samsanit](https://discourse.processing.org/u/Samsanit)\
**Post date:** [June 22, 2018, 9:55pm UTC](https://discourse.processing.org/t/a-caught-error-exception-occurred-on-raspberry-pi/1129/6 "2018-06-22T21:55:01Z")

</div>

Awesome thank you for explaining that makes a lot of sense! I have super limited experience in this so that explanation makes this insanely clearer. Thanks a ton! I have to do more graphics in the future and this is going to be very helpful!
