RPCHandler Setup: Missing Delimiter

I have setup an RPCHandler more or less like the one prescribed in the Ignition Programmer’s Guide. However, I’ve run into an issue.

I’ve called my function like this:

String csv = null; ModuleRPC test = ModuleRPCFactory.create("alarmbenchmark", ModuleRPC.class); csv = test.helloWorld();

When I use it in this way, I receive an error (I can post the full stack-trace if needed):

[Fatal Error] :3:11: The end-tag for element type "Response" must end with a '>' delimiter. … Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Unable to read response from Gateway

And my RPCHandler in the Gateway Scope is defined like this:

public class RPCHandler implements ModuleRPC {
       
       private GatewayContext context;
       
       
       public RPCHandler(GatewayContext context){
              this.context = context;
       }
       
       
       public String helloWorld(){
              return "Hello World!";
              
       }
}

And my ModuleRPC in the common package is like this:

public interface ModuleRPC {
       String helloWorld();
}

And lastly the Gateway Hook:

public Object getRPCHandler(ClientReqSession session, Long projectId) { return new RPCHandler(context); }

How can I resolve this error?

Is there an error in the gateway console/logs when this occurs?

Yes, it shows up in the logs. I’ve attached the relevant part of the log because it’s quite long and it’s probably easier to read in a text editor.
missingdelimiter.txt (9.34 KB)

Ok, the important pieces are these:

java.lang.ClassNotFoundException: com.konnection.utils.ModuleRPC
java.lang.NoClassDefFoundError: com/alarmbenchmark/gateway/RPCHandler

What does your module XML look like? How is your project structured? What jars and hook classes are you loading into which scopes?

[code]<?xml version="1.0" encoding="UTF-8"?>

alarmbenchmark
Alarm Benchmark Module
blank
license.html
index.html
1.6.0.623
7.6.0
5

<!-- Add the dependencies for each scope -->
<depends scope="D">fpmi</depends>

<!-- Load in our jars for each scope -->
<jar scope="D">alarmbenchmark-designer.jar.pack.gz</jar>
<jar scope="CD">alarmbenchmark-KasaUtils.jar.pack.gz</jar>
<jar scope="CD">alarmbenchmark-client.jar.pack.gz</jar>
<jar scope="G">alarmbenchmark-gateway.jar</jar>


<!-- Tell the Gateway and/or Designer where to find the hooks -->
<hook scope="D">com.alarmbenchmark.AlarmBenchmarkDesignerHook</hook>
<hook scope="G">com.alarmbenchmark.gateway.GatewayHook</hook>
[/code]

I see that the jar scope on KasaUtils is “CD” and I tried to change this to “CDG” however it doesn’t seem to have any effect and I still get the same error.

It doesn’t look like you have a common project, which would be a project whose jar is scoped both CD and G and would be the one that contains the RPC interface.

Thanks, you are correct. I used the skeleton project creator to create a new workspace with a common project inside of it and then I compared the ant build files and module.xml and made changes to my existing workspace to re-purpose KasaUtils as the common project.