Grails远程插件RMI MissingMethodException

时间:2011-10-26 15:26:21

标签: grails grails-plugin

我想使用grails remoting插件连接到远程RMI服务。 所以我使用grails install-plugin remoting命令安装了它。然后我创建了RemoteService.groovy,如下所示

class RemoteService {
static remote = [
    protocol: 'rmi',
    iface: RemoteInterface,
    host: 'localhost',
    port: '1199',
]
}

RemoteInterface.java在src / java文件夹中定义:

public interface RemoteInterface{
   void sayHello(String name);
}

我也有以下控制器:

class MyController {
def remoteService
def index = {
    remoteService.sayHello("Andrey")
}
}

然后我启动应用程序并导航到http://localhost:8080/MyContoller,我得到sayHello - MissingMethodException。我没有找到如何解决这个问题。

1 个答案:

答案 0 :(得分:0)

尝试在RemoteService中声明此方法,如下所示:

class RemoteService {
static remote = [
    protocol: 'rmi',
    iface: RemoteInterface,
    host: 'localhost',
    port: '1199',
]

void sayHello(String name){}
}
相关问题