# Uncaught exception executing batch contex

**URL:** <https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555>\
**Category:** Ignition\
**Created:** [May 10, 2021, 9:51pm UTC](https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555 "2021-05-10T21:51:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vrautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vrautomation/32/11155_2.png) [@vrautomation](https://forum.inductiveautomation.com/u/vrautomation)\
**Post date:** [May 10, 2021, 9:51pm UTC](https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555/1 "2021-05-10T21:51:54Z")

</div>

Hello all Ignition’s fans!

I have tag value change script that calculate a dataset tag and then write back this dataset to a memory tag.

The dataset is good and is written in the tag. I can check in the tag and the dataset is ok.

But in the logger, I have this error:  
“Uncaught exception executing batch contex”

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/756fc8993bf4452f0bbfe5d324bb1b917c8d41c1.png)

Can someone help me?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 10, 2021, 9:52pm UTC](https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555/2 "2021-05-10T21:52:39Z")

</div>

Can you expand it by clicking the “+” button and let us know what version of Ignition you are using?

---

<div class="post-metadata">

**Author:** ![vrautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vrautomation/32/11155_2.png) [@vrautomation](https://forum.inductiveautomation.com/u/vrautomation)\
**Post date:** [May 10, 2021, 9:56pm UTC](https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555/3 "2021-05-10T21:56:58Z")

</div>

Ignition 8.0.3

The complete listing of the error is about 2000 lines.

Here are the first lines.  
java.lang.StackOverflowError: null

at java.base/java.lang.Class.privateGetPublicMethods(Unknown Source)

at java.base/java.lang.Class.getMethods(Unknown Source)

at org.json.JSONObject.populateMap(JSONObject.java:846)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

at org.json.JSONObject.populateMap(JSONObject.java:873)

at org.json.JSONObject.(JSONObject.java:259)

at org.json.JSONObject.wrap(JSONObject.java:1460)

---

<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:** [May 10, 2021, 9:59pm UTC](https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555/4 "2021-05-10T21:59:17Z")

</div>

> [@vrautomation](#):
>
> java.lang.StackOverflowError

Long exceptions are typical for these. IIRC, this (circular refs in JSON) was fixed not that long ago.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 10, 2021, 10:13pm UTC](https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555/5 "2021-05-10T22:13:44Z")

</div>

Yes, I also think this is a bug that was fixed, and you are on a relatively ancient version so it would be worth your time to upgrade.

---

<div class="post-metadata">

**Author:** ![vrautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/vrautomation/32/11155_2.png) [@vrautomation](https://forum.inductiveautomation.com/u/vrautomation)\
**Post date:** [May 10, 2021, 10:15pm UTC](https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555/6 "2021-05-10T22:15:39Z")

</div>

Oups sorry.

I’m on 8.1.3. We just upgraded 1 month ago and we cannot upgrade until Sepasoft can support a newer version.

I have other scripts that are writting dataset to memory tags. And they are working fine. So why this particular tags? I must say the script is inside a UDT.

Any workaround?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 10, 2021, 10:17pm UTC](https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555/7 "2021-05-10T22:17:14Z")

</div>

It’s got something to do with the contents/objects you’ve put into the dataset… hard to say without seeing your script.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 10, 2021, 10:21pm UTC](https://forum.inductiveautomation.com/t/uncaught-exception-executing-batch-contex/46555/8 "2021-05-10T22:21:02Z")

</div>

Okay, found an open ticket where this StackOverflowError will occur when trying to encode a QualityCode object, so that’s one thing to look for (or by extension a QualifiedValue object).
