# Problem with parent project and SDK module

**URL:** <https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382>\
**Category:** Module Development\
**Created:** [February 27, 2023, 7:11pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382 "2023-02-27T19:11:10Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 28, 2023, 4:41pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/21 "2023-02-28T16:41:20Z")

</div>

`Caused by: java.lang.ClassCastException: class com.inductiveautomation.ignition.common.script.ProjectScriptModule cannot be cast to class com.inductiveautomation.ignition.common.Dataset (com.inductiveautomation.ignition.common.script.ProjectScriptModule and com.inductiveautomation.ignition.common.Dataset are in unnamed module of loader 'app')`

I really don't think the gateway scripting project is relevant at all here.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 28, 2023, 4:45pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/22 "2023-02-28T16:45:15Z")

</div>

I think that Gateway Scripting Project is relevant, because when I write the name of any project the module stops working and when it is empty it works correctly, as if I am missing to configure something inside the module to work from the gateway of that project.  
it is as if when defining a project, it will not find the module to perform the task, so the incomplete script cannot be executed and presents the error.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 28, 2023, 4:51pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/23 "2023-02-28T16:51:23Z")

</div>

Okay, so whether it's set might be relevant to _how_ you hit it, but unconditionally, the problem lies in your code; you've got a variable that's a ProjectScriptModule (somehow) but you're trying to cast it to a Dataset.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [March 1, 2023, 2:38pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/24 "2023-03-01T14:38:24Z")

</div>

Hi PGriffith, I was checking more in detail the error message and I found that the PyObject I get from the StringMap varies its order according to where it is executed, and one of the dataset was linked to a fixed position to extract the data, I changed this line:

```
Dataset ds = (Dataset) stringMap.values().get(0);

```

To the following:

```
Dataset ds = (Dataset) stringMap. __finditem__ ("ds2"). __tojava__ (java.lang.Object.class);

```

thank you very much for all the help

[Previous page](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382.md?page=1)
