Home Help Center

why is my Ice.Application.communicator() is null?

Just I installed the Ice 3.4.1 and eclipse plug-in (v 3.3.1.20100304), wrote the following code:


@Override
public int run(String[] arg0) {
Communicator communicator = communicator();
Ice.ObjectPrx obj = communicator().stringToProxy("hello:tcp -h 127.0.0.1 -p 10000");
HelloPrx hello = HelloPrxHelper.uncheckedCast(obj);
hello.sayHello();
return 0;
}

But I find my communicator is always null. Why? How do I solve this problem?

Comments

  • SystemSystem Member
    It's my mistake.

    Server server = new Server();
    int status = server.run(args);
    System.exit(status);

    shuold be that:


    Server server = new Server();
    int status = server.main("server",args);
    System.exit(status);
Sign In or Register to comment.