# Are Gateway Event message handler scripts known to not throw errors when imports are wrong / unimported methods are used?

**URL:** <https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [November 12, 2024, 9:17pm UTC](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538 "2024-11-12T21:17:07Z")\
**Posts on this page:** 8\
**Page:** 2

<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:** [November 14, 2024, 12:10am UTC](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538/21 "2024-11-14T00:10:06Z")

</div>

It does suck that we're handcuffed to Jython and all its issues.

---

<div class="post-metadata">

**Author:** ![sherman](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sherman](https://forum.inductiveautomation.com/u/sherman)\
**Post date:** [November 14, 2024, 12:12am UTC](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538/22 "2024-11-14T00:12:29Z")

</div>

It is very unfortunate, I agree. Better than nothing, but if only jython had made it to 3.x 🙏 🙏 🙏 🙏

---

<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:** [November 14, 2024, 12:27am UTC](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538/23 "2024-11-14T00:27:52Z")

</div>

> [@sherman](#):
>
> but this was not a particularly helpful statement, Phil

Why? The answer to your problems with jython sockets is to use java sockets (in jython). 🤷‍♂️

Whining about the situation once or twice is understandable. Beyond that, it inspires pointed commentary.

> [@sherman](#):
>
> **in the ways it is advertised to work**.

That is simply unfair to IA. They advertise support for the python language (syntax) in the form of **jython** , not any other bindings or libraries. And have reliably pointed this out since I started using their stuff 16 years ago.

---

<div class="post-metadata">

**Author:** ![sherman](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sherman](https://forum.inductiveautomation.com/u/sherman)\
**Post date:** [November 14, 2024, 12:37am UTC](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538/24 "2024-11-14T00:37:03Z")

</div>

I already finished my complaining, I was providing the reference in case it was helpful as I had previously made an unreferenced claim. It doesn't make it any more broken, nor was any of this part of my original issue -- it was all in response to **your** questioning about auxiliary issues. You literally asked for it.

> That is simply unfair to IA. They advertise support for the python language (syntax) in the form of **jython** , not any other bindings or libraries. And have reliably pointed this out since I started using their stuff 16 years ago.

While I might agree that it is unfair to the IA developers who are so kind as to help with our issues, I can't say I would extend that to IA's marketing team:

> **[One Industrial Platform for SCADA, IIoT, MES, and More | Ignition](https://inductiveautomation.com/ignition/)**
>
> Ignition is the universal industrial platform for SCADA, MES, IIoT and more. Connect all your data across your entire enterprise and applications.

Not a single reference to the word "Java" nor "Jython". That is likely not an accident, as it is not exactly going to draw attention in a positive way.

[Top of the IA University scripting section](https://www.inductiveuniversity.com/courses/ignition/scripting-in-ignition/8.1). It says "Python" not "Jython".

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/f/0f398b1ce807150dfc2623c0e9ee8ea6309141c4.png)

Java and jython are also noticibly missing from this page. Entirely.

They do **not** advertise that these are Jython bindings, they advertise **Python scripting**. While digging into documentation and forums makes it more clear, that is **not** included in "Advertising".

---

<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:** [November 14, 2024, 12:43am UTC](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538/25 "2024-11-14T00:43:28Z")

</div>

> [@sherman](#):
>
> Java and jython are also noticibly missing from this page. Entirely.

> [@sherman](#):
>
> that is **not** included in "Advertising".

Fair enough.

_Psst!_[DatagramSocket](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/net/DatagramSocket.html)

I'll bet you can send UDP packets out of your gateway, with that, in 30 minutes if you try.

---

<div class="post-metadata">

**Author:** ![sherman](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sherman](https://forum.inductiveautomation.com/u/sherman)\
**Post date:** [November 14, 2024, 12:46am UTC](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538/26 "2024-11-14T00:46:03Z")

</div>

You're probably right, and next time I have to try I will. Already worked my way around it for now

---

<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:** [November 14, 2024, 4:27pm UTC](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538/27 "2024-11-14T16:27:34Z")

</div>

For what it's worth, this is one area where LLMs are usually ~okay.  
Either ask for "this Python snippet of code I have, translated to Jython with Java socket imports" or "write a snippet of Jython code, using Java imports". Sometimes you have to suggest specific classes to import, but there's so many examples of basic Java socket code floating around LLMs are fine at translating it.

---

<div class="post-metadata">

**Author:** ![sherman](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sherman](https://forum.inductiveautomation.com/u/sherman)\
**Post date:** [November 14, 2024, 5:19pm UTC](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538/28 "2024-11-14T17:19:32Z")

</div>

Oh totally -- thats how I got the Java code for the screenshot in the first place. LLMs \>= GPT4 are pretty good at reading the documentation for 8.1 and are very helpful!

[Previous page](https://forum.inductiveautomation.com/t/are-gateway-event-message-handler-scripts-known-to-not-throw-errors-when-imports-are-wrong-unimported-methods-are-used/98538.md?page=1)
