# Module class loading

**URL:** <https://forum.inductiveautomation.com/t/module-class-loading/100816>\
**Category:** Module Development\
**Tags:** ignition81\
**Created:** [January 13, 2025, 6:41pm UTC](https://forum.inductiveautomation.com/t/module-class-loading/100816 "2025-01-13T18:41:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pllincol](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@pllincol](https://forum.inductiveautomation.com/u/pllincol)\
**Post date:** [January 13, 2025, 6:41pm UTC](https://forum.inductiveautomation.com/t/module-class-loading/100816/1 "2025-01-13T18:41:53Z")

</div>

Hello all  
Ive started the journey into module development and im currently facing the following issue. My module is using the AWS sdk and ive included the following in my build.gradle.kts gateway scope:

```python
modlApi(platform("software.amazon.awssdk:bom:2.29.47"))
modlApi("software.amazon.awssdk:sdk-core")
modlApi("software.amazon.awssdk:auth")
modlApi("software.amazon.awssdk:aws-core")
modlApi("software.amazon.awssdk:s3")

```

When running some of the functions from a button event script im encountering an error:  
`NoSuchFieldError: java.lang.NoSuchFieldError:AUTH_SCHEME_PROVIDER`

I added some additional logging to my gateway module hook to identify where the classes are being loaded from and found the following

| GatewayHook | 11Jan2025 20:02:54 | Successfully loaded: software.amazon.awssdk.services.s3.S3Client from file:/usr/local/ignition/data/jar-cache/com.inductiveautomation.ignition.examples.scripting.ScriptingFunctionG/\_\_957923360\_\_s3-2.29.47.jar |
| --- | --- | --- |
| GatewayHook | 11Jan2025 20:02:54 | Successfully loaded: software.amazon.awssdk.core.SdkClient from file:/usr/local/ignition/lib/core/gateway/sdk-core-2.20.7.jar |
| GatewayHook | 11Jan2025 20:02:54 | Successfully loaded: software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider from file:/usr/local/ignition/data/jar-cache/com.inductiveautomation.ignition.examples.scripting.ScriptingFunctionG/\_\_957923360\_\_auth-2.29.47.jar |

It appears that classes in software.amazon.awssdk.core are being loaded from lib/core/gateway/sdk-core which is the igntion sdk core. I suspect this a name clash between the aws sdk-core jar and igntion sdk-core jar. Is there a way to fix this issue. Ive included my module.xml file for reference

> **Summary**
>
> ```python
> <?xml version="1.0" encoding="UTF-8"?>
> <modules>
> <module>
> <name>Scripting Function G</name>
> <id>com.inductiveautomation.ignition.examples.scripting.ScriptingFunctionG</id>
> <version>0.0.1-SNAPSHOT</version>
> <description>A short sentence describing what it does, but not much longer than this.</description>
> <requiredIgnitionVersion>8.1.11</requiredIgnitionVersion>
> <freeModule>false</freeModule>
> <hook scope="G">com.inductiveautomation.ignition.examples.scripting.gateway.GatewayHook</hook>
> <hook scope="C">com.inductiveautomation.ignition.examples.scripting.client.ClientHook</hook>
> <hook scope="D">com.inductiveautomation.ignition.examples.scripting.designer.DesignerHook</hook>
> <requiredFrameworkVersion>8</requiredFrameworkVersion>
> <jar scope="CD">client-0.0.1-SNAPSHOT.jar</jar>
> <jar scope="CDG">common-0.0.1-SNAPSHOT.jar</jar>
> <jar scope="D">designer-0.0.1-SNAPSHOT.jar</jar>
> <jar scope="G">s3-2.29.47.jar</jar>
> <jar scope="G">aws-xml-protocol-2.29.47.jar</jar>
> <jar scope="G">aws-query-protocol-2.29.47.jar</jar>
> <jar scope="G">protocol-core-2.29.47.jar</jar>
> <jar scope="G">arns-2.29.47.jar</jar>
> <jar scope="G">aws-core-2.29.47.jar</jar>
> <jar scope="G">auth-2.29.47.jar</jar>
> <jar scope="G">regions-2.29.47.jar</jar>
> <jar scope="G">sdk-core-2.29.47.jar</jar>
> <jar scope="G">profiles-2.29.47.jar</jar>
> <jar scope="G">crt-core-2.29.47.jar</jar>
> <jar scope="G">http-auth-2.29.47.jar</jar>
> <jar scope="G">http-auth-aws-2.29.47.jar</jar>
> <jar scope="G">http-auth-spi-2.29.47.jar</jar>
> <jar scope="G">identity-spi-2.29.47.jar</jar>
> <jar scope="G">checksums-2.29.47.jar</jar>
> <jar scope="G">checksums-spi-2.29.47.jar</jar>
> <jar scope="G">retries-2.29.47.jar</jar>
> <jar scope="G">retries-spi-2.29.47.jar</jar>
> <jar scope="G">apache-client-2.29.47.jar</jar>
> <jar scope="G">netty-nio-client-2.29.47.jar</jar>
> <jar scope="G">http-client-spi-2.29.47.jar</jar>
> <jar scope="G">metrics-spi-2.29.47.jar</jar>
> <jar scope="G">json-utils-2.29.47.jar</jar>
> <jar scope="G">utils-2.29.47.jar</jar>
> <jar scope="G">endpoints-spi-2.29.47.jar</jar>
> <jar scope="G">http-auth-aws-eventstream-2.29.47.jar</jar>
> <jar scope="G">annotations-2.29.47.jar</jar>
> <jar scope="G">reactive-streams-1.0.4.jar</jar>
> <jar scope="G">slf4j-api-1.7.36.jar</jar>
> <jar scope="G">eventstream-1.0.1.jar</jar>
> <jar scope="G">third-party-jackson-core-2.29.47.jar</jar>
> <jar scope="G">httpclient-4.5.13.jar</jar>
> <jar scope="G">httpcore-4.4.16.jar</jar>
> <jar scope="G">commons-codec-1.17.1.jar</jar>
> <jar scope="G">netty-codec-http2-4.1.115.Final.jar</jar>
> <jar scope="G">netty-codec-http-4.1.115.Final.jar</jar>
> <jar scope="G">netty-handler-4.1.115.Final.jar</jar>
> <jar scope="G">netty-codec-4.1.115.Final.jar</jar>
> <jar scope="G">netty-transport-classes-epoll-4.1.115.Final.jar</jar>
> <jar scope="G">netty-transport-native-unix-common-4.1.115.Final.jar</jar>
> <jar scope="G">netty-transport-4.1.115.Final.jar</jar>
> <jar scope="G">netty-buffer-4.1.115.Final.jar</jar>
> <jar scope="G">netty-resolver-4.1.115.Final.jar</jar>
> <jar scope="G">netty-common-4.1.115.Final.jar</jar>
> <jar scope="G">commons-logging-1.2.jar</jar>
> <jar scope="G">gateway-0.0.1-SNAPSHOT.jar</jar>
> </module>
> </modules>
> 
> ```

---

<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:** [January 13, 2025, 6:52pm UTC](https://forum.inductiveautomation.com/t/module-class-loading/100816/2 "2025-01-13T18:52:07Z")

</div>

`sdk-core-2.20.7.jar` isn't one of our platform dependencies.

Did you maybe place it there yourself prior to trying to move all of this into a module?

---

<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:** [January 13, 2025, 7:17pm UTC](https://forum.inductiveautomation.com/t/module-class-loading/100816/3 "2025-01-13T19:17:24Z")

</div>

Hmm, I take that back, I see it locally as well. I must have missed it in our build files.

---

<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:** [January 13, 2025, 7:33pm UTC](https://forum.inductiveautomation.com/t/module-class-loading/100816/4 "2025-01-13T19:33:23Z")

</div>

I think your only option may be to use something like the Gradle shadow plugin to relocate `software.amazon.awssdk.*` into something like `software.amazon.awssdk.shadowed.*` at compile time.

See [Relocating Packages](https://gradleup.com/shadow/configuration/relocation/)

---

<div class="post-metadata">

**Author:** ![pllincol](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@pllincol](https://forum.inductiveautomation.com/u/pllincol)\
**Post date:** [January 13, 2025, 7:50pm UTC](https://forum.inductiveautomation.com/t/module-class-loading/100816/5 "2025-01-13T19:50:43Z")

</div>

Thanks for taking a look Kevin, i will investigate the shadow plugin option.
