trouble with jinterface

Roberto Saccon rsaccon@REDACTED
Wed Jul 12 08:54:42 CEST 2006


For a web application I am trying to connect via Jininterface-RPC a
Java-Videoserver (http://osflash.org/red5) to yaws for authentication
purposes. It works fine, with expected result just for the first RPC
call, all subsequent calls fail ("cannot connect to peer node"). If I
restart either the Javer server or yaws, it again just works for the
first RPC call.

I am using latest Erlang distribution compiled form source on Ubuntu
Linux and Java 1.5. Here is how my RPC Java code looks like:

------------------- begin java snippet --------------

OtpSelf self;
try {
  self = new OtpSelf("red5");
  OtpPeer other  = new OtpPeer("mytest@REDACTED");
  OtpConnection connection = self.connect(other);

  String testSess = "mytest@REDACTED";
  OtpErlangList sessList = new OtpErlangList(new OtpErlangString(testSess));
  connection.sendRPC("my_auth","check_sess", sessList);

  OtpErlangObject received = connection.receiveRPC();
  log.info("received: " + received.toString());
  return true;
}
catch (Exception e)
{
  e.printStackTrace();
  return false;
}

------------------- end java snippet --------------

I start yaws with the following nodename paramter:  --sname mytest


The Java exception I get, with the non-first calls, is the following
(just the erlang-part):

java.io.IOException: Cannot connect to peer node
	at com.ericsson.otp.erlang.AbstractConnection.doConnect(AbstractConnection.java:925)
	at com.ericsson.otp.erlang.AbstractConnection.<init>(AbstractConnection.java:187)
	at com.ericsson.otp.erlang.OtpConnection.<init>(OtpConnection.java:80)
	at com.ericsson.otp.erlang.OtpSelf.connect(OtpSelf.java:207)


I also tried with connection cookie as second Parameter when creating
the OptSelf object, but the behaviour is the same, if the cookie has
the right value. If the cookie has the wrong value, the connection is
denied by yaws at the first and all subsequent calls and no exceptions
are thrown at java-side.

Has anybody an idea, whether there is something missing or  wrong with
my approach ?

regards
-- 
Roberto Saccon



More information about the erlang-questions mailing list