Unable to drag and drop svg elements into designer after installing .modl

I'm currently studying and experimenting in ignition sdk modules. And i noticed that when a perspective-component-minimal module is installed in the gateway, the drag and drop svg action into the designer is not working anymore.

This is the behaviour when the module is installed.

image
draganddropsvg

And when i uninstalled/removed the perspective-component-minimal module
draganddropsvg2

Other details and information:

  1. Ignition version used - 8.1.45 (b2025010709)
  2. Java version (Used in gradle build) - java version "17" 2021-09-14 LTS
  3. Gradlewrapper was used to build the perspective-component-minimal
  4. Initially, the module has error, so to bypass the error, i commented out the part in GatewayHook script.
    ERROR:
com.inductiveautomation.ignition.common.modules.ModuleLoadException: Unable to load hook class "io.ia.example.perspective.min.gateway.OneComponentGatewayHook" for module "io.ia.example.perspective.min".
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.loadHook(ModuleManagerImpl.java:2375)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.load(ModuleManagerImpl.java:2048)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.startupModule(ModuleManagerImpl.java:1183)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$2.call(ModuleManagerImpl.java:734)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.executeModuleOperation(ModuleManagerImpl.java:913)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.installModuleInternal(ModuleManagerImpl.java:700)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$InstallCommand.doExecute(ModuleManagerImpl.java:1915)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$AbstractModuleCommand.execute(ModuleManagerImpl.java:1864)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$Receiver.receiveCall(ModuleManagerImpl.java:1820)
	at com.inductiveautomation.ignition.gateway.redundancy.QueueableMessageReceiver.receiveCall(QueueableMessageReceiver.java:47)
	at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.dispatchMessage(RedundancyManagerImpl.java:1044)
	at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl$ExecuteTask.run(RedundancyManagerImpl.java:1112)
	at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:550)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: jakarta/servlet/http/HttpServletResponse
	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source)
	at java.base/java.lang.Class.getMethodsRecursive(Unknown Source)
	at java.base/java.lang.Class.getMethod0(Unknown Source)
	at java.base/java.lang.Class.getMethod(Unknown Source)
	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.loadHook(ModuleManagerImpl.java:2361)
	... 18 more
Caused by: java.lang.ClassNotFoundException: jakarta.servlet.http.HttpServletResponse
	at java.base/java.net.URLClassLoader.findClass(Unknown Source)
	at com.inductiveautomation.ignition.gateway.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:37)
	at com.inductiveautomation.ignition.gateway.modules.ModuleClassLoader.loadClass(ModuleClassLoader.java:104)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 24 more

8.1.45 (b2025010709)
Azul Systems, Inc. 17.0.13

The part in gatewayhook that I commented out to successfully install the module without error.

import jakarta.servlet.http.HttpServletResponse;
.
.
.
    @Override
    public void onMountedResourceRequest(String resourcePath, HttpServletResponse response) {
        super.onMountedResourceRequest(resourcePath, response);
    }
}

Did i do something wrong that caused this bug, or is it a recurring issue that extends beyond the module I’m currently working on/experimenting with? The drag-and-drop feature in the Designer is one of the functionalities I really need in order to build the project with my own custom modules.

Are there any errors in the designer console with your module loaded?

The module seems fine

image

Hmm.

I think the class loading error in the example is causing the fetch of the component Javascript to fail (return a 404 page) which may be causing knock-on effects that end up with drag and drop not working. At least, that's my best guess at the moment.

If you go into the OneComponentGatewayHook and remove this method implementation:

    @Override
    public void onMountedResourceRequest(String resourcePath, HttpServletResponse response) {
        super.onMountedResourceRequest(resourcePath, response);
    }

Then optimize imports and rebuild the module, it should work. The underlying problem is the Jetty upgrade we did in 8.1.49:

1 Like