2011-10-26 8 views
0

リモートRMIサービスに接続するために、grails remotingプラグインを使いたいと思います。 grails install-plugin remotingコマンドを使用してインストールしました。Grails remotingプラグインRMI MissingMethodException

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

私はまた、次のコントローラがあります:

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

そしてを

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

RemoteInterface.javaはSRC/Javaのフォルダに定義されているが、次のようにそれから私はRemoteService.groovyを作成しました私はアプリケーションを起動し、http://localhost:8080/MyContollerに移動し、sayHello - MissingMethodExceptionを取得します。私はこの問題を解決する方法を見つけることができませんでした。

答えて

0

このようなあなたのRemoteServiceでこのメソッドを宣言してください:

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

void sayHello(String name){} 
}