# Basic RPC Gateway-Client gives "Module Not Found"

**URL:** <https://forum.inductiveautomation.com/t/basic-rpc-gateway-client-gives-module-not-found/9341>\
**Category:** Module Development\
**Created:** [November 14, 2014, 11:29am UTC](https://forum.inductiveautomation.com/t/basic-rpc-gateway-client-gives-module-not-found/9341 "2014-11-14T11:29:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JarrenLange](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@JarrenLange](https://forum.inductiveautomation.com/u/JarrenLange)\
**Post date:** [November 14, 2014, 11:29am UTC](https://forum.inductiveautomation.com/t/basic-rpc-gateway-client-gives-module-not-found/9341/1 "2014-11-14T11:29:40Z")

</div>

Hi there…

I am trying to get basic RPC functionality from the client to the gateway.

I have setup my RPC code as set out in the Programmers guide ![:thumb_right:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/2026e28c0c425034352c1b75807edf956adc75f4.gif ":thumb\_right:") .

In both projects (client, gateway) there is a copy of the ModuleRPC interface.

[code]package com.versata.gblocks.common;

public interface ModuleRPC {  
String getGreeting(String firstName);  
}  
[/code]

In the Gateway project is the implementation:

[code]package com.versata.gblocks.gateway;

import com.versata.gblocks.common.ModuleRPC;

public class ModuleRPCImpl implements ModuleRPC {  
public String getGreeting(String firstName){  
return "Hello, " + firstName;

```
	} 
}[/code]

```

In the Gateway hook:

[code]package com.versata.gblocks.gateway;

import com.inductiveautomation.ignition.common.licensing.LicenseState;  
import com.inductiveautomation.ignition.gateway.clientcomm.ClientReqSession;  
import com.inductiveautomation.ignition.gateway.model.AbstractGatewayModuleHook;  
import com.inductiveautomation.ignition.gateway.model.GatewayContext;

public class GatewayHook extends AbstractGatewayModuleHook {

```
@Override
public void setup(GatewayContext context) {
	// TODO Write code, override methods as needed

}

@Override
public void shutdown() {

}

@Override
public void startup(LicenseState licenseState) {

}   
@Override
public Object getRPCHandler(ClientReqSession session, Long projectId) {      
	return new ModuleRPCImpl();   
}

```

}  
[/code]

In the client code at the end of the constructor:

`
		ModuleRPC rpc = ModuleRPCFactory.create("com.versata.gblocks.gateway.ModuleRPCImpl'", ModuleRPC.class); 
		System.out.println( rpc.getGreeting("Bill") );`

However in the Designer I get the following compact error:

[quote]SerializationException: Error deserializing element “\<c”  
caused by UndeclaredThrowableException  
caused by GatewayException: Module “com.versata.gblocks.gateway.ModuleRPCImpl’” not found.  
caused by IllegalArgumentException: Module “com.versata.gblocks.gateway.ModuleRPCImpl’” not found.  
[/quote]

I copied the example directly but then was getting an error with the code from the example:

`ModuleRPC rpc = ModuleRPCFactory.create(ModuleMeta.MODULE_ID, ModuleRPC.class); 
System.out.println( rpc.getGreeting("Bill") );`  
Where it complained about the function `getGreeting(String)`not existing in an alarm module `com.inductiveautomation.alarm-notification` ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:") .

So I changed the code to the implementation given first.

Is there anything obvious I have missed.

I just want to finish setting up the basics, so I can move on to the nitty gritty ![:/](https://us1.discourse-cdn.com/inductiveautomation/original/1X/8e510869ae26fbd7ab76e1e731ceea2054ef109c.gif "Hrm") .

Any help will be appreciated ![:prayer:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e5a7e3b63facc151ea73e3b45db7bdb3d4bdc316.gif ":prayer:") .

---

<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 15, 2014, 11:19am UTC](https://forum.inductiveautomation.com/t/basic-rpc-gateway-client-gives-module-not-found/9341/2 "2014-11-15T11:19:23Z")

</div>

It looks like you’ve got a single quote character that doesn’t belong in the moduleId String in your call to create the ModuleRPC instance.
