# Unable to load hook class

**URL:** <https://forum.inductiveautomation.com/t/unable-to-load-hook-class/15120>\
**Category:** Module Development\
**Created:** [August 20, 2017, 9:18pm UTC](https://forum.inductiveautomation.com/t/unable-to-load-hook-class/15120 "2017-08-20T21:18:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark.om](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@mark.om](https://forum.inductiveautomation.com/u/mark.om)\
**Post date:** [August 20, 2017, 9:19pm UTC](https://forum.inductiveautomation.com/t/unable-to-load-hook-class/15120/1 "2017-08-20T21:19:00Z")

</div>

Hello

I have created a simple designer scoped module called 'HelloWorld'. It contains one method that returns 'hello world'. Simple as that, just for a first step in module development. It follows a very simple project structure (i.e. no separate build folder) to cut down troubleshooting.

I have used a maven 'quickstart' template in eclipse to create the project then copied the relevant ignition dependencies etc into the pom file. It compiles and builds without error. I have signed the resultant modl and imported it into the gateway.

However it has the status of 'faulted' in red, not the glorious green 'running' status that I had hoped for. The error is below which indicates I have something wrong with the hook path... but the hook path seems fine to me. What am I missing here?

Attached is the modl below.

[helloworld-signed.modl](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1caf8d6b3436c138efe55cd867c91260095d7295.modl) (2.4 KB)

> com.inductiveautomation.ignition.common.modules.ModuleLoadException: Unable to load hook class "com.example.simple.helloworld.ExampleDesignerHook" for module "com.example.simple.helloworld".  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.loadHook(ModuleManagerImpl.java:2159)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.load(ModuleManagerImpl.java:1849)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.startupModule(ModuleManagerImpl.java:1051)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$2.call(ModuleManagerImpl.java:648)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.executeModuleOperation(ModuleManagerImpl.java:801)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.installModuleInternal(ModuleManagerImpl.java:624)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.access$900(ModuleManagerImpl.java:134)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$InstallCommand.execute(ModuleManagerImpl.java:1722)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$Receiver.receiveCall(ModuleManagerImpl.java:1659)  
> at com.inductiveautomation.ignition.gateway.redundancy.QueueableMessageReceiver.receiveCall(QueueableMessageReceiver.java:45)  
> at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.dispatchMessage(RedundancyManagerImpl.java:739)  
> at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl$ExecuteTask.run(RedundancyManagerImpl.java:760)  
> at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:546)  
> at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)  
> at java.util.concurrent.FutureTask.run(Unknown Source)  
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)  
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
> at java.lang.Thread.run(Unknown Source)  
> Caused by: java.lang.ClassNotFoundException: com.example.simple.helloworld.ExampleDesignerHook  
> at java.net.URLClassLoader.findClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.loadHook(ModuleManagerImpl.java:2138)  
> ... 19 more

> 7.9.3 (b2017060210)  
> Oracle Corporation 1.8.0\_144

---

<div class="post-metadata">

**Author:** ![mark.om](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@mark.om](https://forum.inductiveautomation.com/u/mark.om)\
**Post date:** [August 20, 2017, 9:30pm UTC](https://forum.inductiveautomation.com/t/unable-to-load-hook-class/15120/2 "2017-08-20T21:30:40Z")

</div>

Hmm, I opened the modl and cannot find the jar file in there. What could cause this?

Attached below is the project.

[helloworld.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/068354baf84b2e25656401ad5d4f909eaa181330.zip) (27.6 KB)

---

<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:** [August 21, 2017, 12:00am UTC](https://forum.inductiveautomation.com/t/unable-to-load-hook-class/15120/3 "2017-08-21T00:00:32Z")

</div>

A minimal project using the ignition maven plugin should have two maven modules: one for the build, and one for the code.

---

<div class="post-metadata">

**Author:** ![mark.om](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@mark.om](https://forum.inductiveautomation.com/u/mark.om)\
**Post date:** [August 21, 2017, 1:10am UTC](https://forum.inductiveautomation.com/t/unable-to-load-hook-class/15120/4 "2017-08-21T01:10:36Z")

</div>

Ok.

Well I have now changed the code to have a both a build and code module (attached). Now I can see the jar within the modl. However still the error persists when loaded into the gateway. Quite frustrating that a simple 'hello world' is taking so long to get going.. Can you give me some pointers? Attached is the very simple project.

[HelloWorldExample.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e1138d8df6471c72dddcfe140e5dfebd9308d0b4.zip) (32.2 KB)

> com.inductiveautomation.ignition.common.modules.ModuleLoadException: Unable to load hook class "com.testing.examples.stp.ExampleModuleHook" for module "com.testing.examples.simplehelloworld".  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.loadHook(ModuleManagerImpl.java:2159)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.load(ModuleManagerImpl.java:1849)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.startupModule(ModuleManagerImpl.java:1051)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$2.call(ModuleManagerImpl.java:648)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.executeModuleOperation(ModuleManagerImpl.java:801)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.installModuleInternal(ModuleManagerImpl.java:624)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.access$900(ModuleManagerImpl.java:134)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$InstallCommand.execute(ModuleManagerImpl.java:1722)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$Receiver.receiveCall(ModuleManagerImpl.java:1659)  
> at com.inductiveautomation.ignition.gateway.redundancy.QueueableMessageReceiver.receiveCall(QueueableMessageReceiver.java:45)  
> at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.dispatchMessage(RedundancyManagerImpl.java:739)  
> at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl$ExecuteTask.run(RedundancyManagerImpl.java:760)  
> at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:546)  
> at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)  
> at java.util.concurrent.FutureTask.run(Unknown Source)  
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)  
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
> at java.lang.Thread.run(Unknown Source)  
> Caused by: java.lang.NoClassDefFoundError: com/inductiveautomation/ignition/designer/model/AbstractDesignerModuleHook  
> at java.lang.ClassLoader.defineClass1(Native Method)  
> at java.lang.ClassLoader.defineClass(Unknown Source)  
> at java.security.SecureClassLoader.defineClass(Unknown Source)  
> at java.net.URLClassLoader.defineClass(Unknown Source)  
> at java.net.URLClassLoader.access$100(Unknown Source)  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.security.AccessController.doPrivileged(Native Method)  
> at java.net.URLClassLoader.findClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.loadHook(ModuleManagerImpl.java:2138)  
> ... 19 more  
> Caused by: java.lang.ClassNotFoundException: com.inductiveautomation.ignition.designer.model.AbstractDesignerModuleHook  
> at java.net.URLClassLoader.findClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> ... 31 more

> 7.9.3 (b2017060210)  
> Oracle Corporation 1.8.0\_144

---

<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:** [August 21, 2017, 2:00am UTC](https://forum.inductiveautomation.com/t/unable-to-load-hook-class/15120/5 "2017-08-21T02:00:06Z")

</div>

In your ignition-maven-plugin configuration you’ve got the project and hook specified as being gateway scoped.

---

<div class="post-metadata">

**Author:** ![mark.om](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@mark.om](https://forum.inductiveautomation.com/u/mark.om)\
**Post date:** [August 23, 2017, 10:30am UTC](https://forum.inductiveautomation.com/t/unable-to-load-hook-class/15120/6 "2017-08-23T10:30:10Z")

</div>

Thanks Kevin.

That worked, silly error on my part. Changed the scope to ‘D’ and it is now running.
