# Sketch crashing: IllegalStateException

**URL:** <https://discourse.processing.org/t/sketch-crashing-illegalstateexception/41337>\
**Category:** Libraries\
**Created:** [March 17, 2023, 11:09pm UTC](https://discourse.processing.org/t/sketch-crashing-illegalstateexception/41337 "2023-03-17T23:09:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonnieNightTime](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@JonnieNightTime](https://discourse.processing.org/u/JonnieNightTime)\
**Post date:** [March 17, 2023, 11:09pm UTC](https://discourse.processing.org/t/sketch-crashing-illegalstateexception/41337/1 "2023-03-17T23:09:36Z")

</div>

Dear All,

I’m getting the following and don’t understand at all what’s happening - I think it is to do with try to play back several videos?

From the console

```auto
Mar 17, 2023 11:07:14 PM com.sun.jna.Native$1 uncaughtException
WARNING: JNA: Callback org.freedesktop.gstreamer.elements.AppSink$2@e7f521c threw the following exception
java.lang.IllegalStateException: Native object has been disposed

```

It goes on …

```auto
at org.freedesktop.gstreamer.glib.NativeObject.getRawPointer(NativeObject.java:119)
	at org.freedesktop.gstreamer.glib.Natives.getRawPointer(Natives.java:178)
	at org.freedesktop.gstreamer.lowlevel.GTypeMapper$2.toNative(GTypeMapper.java:73)
	at com.sun.jna.Function.convertArgument(Function.java:521)
	at com.sun.jna.Function.invoke(Function.java:345)
	at com.sun.jna.Library$Handler.invoke(Library.java:265)
	at jdk.proxy1/jdk.proxy1.$Proxy21.gst_buffer_unmap(Unknown Source)
	at org.freedesktop.gstreamer.Buffer.unmap(Buffer.java:121)
	at processing.video.Movie$NewSampleListener.newSample(Unknown Source)
	at org.freedesktop.gstreamer.elements.AppSink$2.callback(AppSink.java:232)
	at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
	at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)

```

Any illumination would be gratefully appreciated. Best, jnt

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [March 20, 2023, 1:06pm UTC](https://discourse.processing.org/t/sketch-crashing-illegalstateexception/41337/2 "2023-03-20T13:06:37Z")

</div>

Hi @JonnieNightTime,

Is this related to your issue?

> <https://github.com/processing/processing-video/issues/104#issuecomment-570965868>
>
> I've been using \`version 2.0-beta1\` of the video library on some long-running pr…ojects and it's been working great - it especially helped me play 4k video at a good frame rate, where the last official video library release can't play 4k video very well, even on a fast new machine. 
> 
> There's one issue that keeps popping up for me on multiple Windows 10 machines (I'm not sure if it happens on other platforms, but I think it also happened on my Mac). Videos often won't load, and my app will hang. If I wait long enough, I'll get the following error in the console:
> 
> \`WARNING: no real random source present\`
> 
> This seems to be a \[gstreamer error\](https://www.google.com/search?q=%22WARNING%3A+no+real+random+source+present%22) that I can't quite figure out as it's deep under the hood and intermittent. It seems to not matter what the video codec/encoding is. It also seems to stay stuck, and I can't relaunch my app with a video playing successfully until this error shows up in the console. After this error message appears, I can usually launch my app w/video playing again. So it seems like some rogue process is hanging and prevents future videos from working until it finally dies. 
> 
> I'm happy to help test this if anyone else has encountered it and has an idea of how to investigate.

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [March 20, 2023, 4:07pm UTC](https://discourse.processing.org/t/sketch-crashing-illegalstateexception/41337/3 "2023-03-20T16:07:49Z")

</div>

Hi  
Post your code inorder to make your issue more clear
