[erlang-questions] : : First send from JInterface ok, second one blocs?? FOUND THE PROBLEM

Raimo Niskanen <>
Tue May 13 14:38:26 CEST 2008


On Tue, May 13, 2008 at 12:27:05PM +0200, Alexander Lamb wrote:
> Ok,
> 
> I found the solution but I don't understand why:
> 
> When I started the erlang server, I initially wrote:
> 
> erl -mnesia -setcookie rodanotech -sname alex (notice the "sname")
> 
> It started the node as
> 
> ()1>
> 
> But from my Java program I was forced to write:
> 
> "" when sending a message from my mailbox.

Why was you "forced to write" ?
The example I tried used -sname  for
the Erlang node and  for the java node.
And while I wrote it I tried using the short host
name a'la  and  (but not kirk), and it worked.

> 
> For some unknown reason, the first call went ok, the any following one  
> didn't.

That is strange since you can not mix long and short names
in an Erlang network. Perhaps something is not quite
as it should be in Jinterface regarding long vs. short
node names.

> 
> I started a second erlang node to debug the problem and tried using:
> 
> erl -mnesia -setcookie rodanotech -name alex (notice without the "s"  
> before name)
> 
> It started:
> 
> ()1>
> 
> Now it works... but why did it work for each first call when using - 
> sname ??? That's what probably put me on the wrong direction to find  
> the solution!!
> 
> Anyway, thanks a lot for all your help. Once all this is more or less  
> stable, I will try to write a small example to explain what we are  
> doing.
> 
> Alex
> --
> Alexander Lamb
> Founding Associate
> RODANOTECH Sàrl
> 
> 4 ch. de la Tour de Champel
> 1206 Geneva
> Switzerland
> 
> Tel:  022 347 77 37
> Fax: 022 347 77 38
> 
> http://www.rodanotech.ch
> 
> 
> 
> 
> Le 13 mai 08 à 12:13, Vlad Dumitrescu a écrit :
> 
> >Hi,
> >
> >On Tue, May 13, 2008 at 12:04 PM, Alexander Lamb 
> >< > wrote:
> >I added an OtpNodeStatus to follow the status of the connection and on
> >the second call here is what I get:
> >
> >-> LOOKUP (r4) 
> ><- PORT 57266
> >-> MD5 CONNECT TO kirk.local:57266
> >-> HANDSHAKE sendName flags=3332 dist=5 local=
> >-> CLOSE
> >-- CONNECTION ATTEMPT:  INCOMING: false INFO:
> >java.io.IOException: Cannot connect to peer node
> >
> >Because of the CLOSE, the connection attempt from  is
> >refused!
> >
> >Can you set a breakpoint on AbstractConnection.close() and look at  
> >the stack to see who calls it? It would help to know.
> >
> >best regards,
> >Vlad
> >
> 
> 
> 
> 

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list