# java.lang.IllegalStateException: Session is not running

**URL:** <https://forum.inductiveautomation.com/t/java-lang-illegalstateexception-session-is-not-running/112763>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 11, 2025, 4:12pm UTC](https://forum.inductiveautomation.com/t/java-lang-illegalstateexception-session-is-not-running/112763 "2025-12-11T16:12:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwirth](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@bwirth](https://forum.inductiveautomation.com/u/bwirth)\
**Post date:** [December 11, 2025, 4:12pm UTC](https://forum.inductiveautomation.com/t/java-lang-illegalstateexception-session-is-not-running/112763/1 "2025-12-11T16:12:29Z")

</div>

I have done some searches but not seeing a solution. I get this error when triggering to open a popup on a page. (I have a popup that triggers open when certain conditions are met)

> java.lang.IllegalStateException: Session is not running

I know the call that does this and I think I know why (Sessions getting closed abnormally), my question is there any way to test for this condition so I can skip trying to open the popup? I tried putting the openPopup call in a try block and that did not seem to help…

Thanks!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 11, 2025, 4:36pm UTC](https://forum.inductiveautomation.com/t/java-lang-illegalstateexception-session-is-not-running/112763/2 "2025-12-11T16:36:32Z")

</div>

> [@bwirth](#):
>
> in a try block

A plain `try` block will only catch jython exceptions, not java exceptions. There are many examples of double-except clauses on the forum that show how to do this.

[Search for try ... Throwable](https://forum.inductiveautomation.com/search?q=%40pturmel%20try%20Throwable%20order%3Alatest)

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [December 11, 2025, 4:46pm UTC](https://forum.inductiveautomation.com/t/java-lang-illegalstateexception-session-is-not-running/112763/3 "2025-12-11T16:46:50Z")

</div>

> [@pturmel](#):
>
> Search for try ... Throwable

~~This link doesn't seem to behave as intended, I end up with this as a result:~~

~~ 

> **Search result**
>
> ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5e77287dcd39f856db1911250d3dd0bf1db7d9e.png)

 ~~

~~Looks like it's HTML encoding the symbols that are used to denote advanced filter items.~~

manually changing the search to `try . . . throwable` seems to work though.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 11, 2025, 5:00pm UTC](https://forum.inductiveautomation.com/t/java-lang-illegalstateexception-session-is-not-running/112763/4 "2025-12-11T17:00:05Z")

</div>

> [@ryan.white](#):
>
> doesn't seem to behave as intended

Fixed.

---

<div class="post-metadata">

**Author:** ![bwirth](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@bwirth](https://forum.inductiveautomation.com/u/bwirth)\
**Post date:** [December 11, 2025, 5:01pm UTC](https://forum.inductiveautomation.com/t/java-lang-illegalstateexception-session-is-not-running/112763/5 "2025-12-11T17:01:45Z")

</div>

Thank you, sir. Try Except generally catches java errors as long as I don’t try to capture the exception (Exception as e). That’s when I needed the Throwable. Will continue to dig. Thanks!
