[erlang-questions] probelm between java and erlang nodes

Michael McDaniel <>
Fri Oct 27 15:55:17 CEST 2006


On Fri, Oct 27, 2006 at 01:15:22PM +0200, Pablo Álvarez Yáñez wrote:
> Hello,
> I need to call java functions from an erlang program. I have seen the
> examples into the IC lib directory (lib/ic-4.2.11), but if I execute
> an erlang node calling the java node (or vice versa) I get the
> following error:
> 
> ----> In the java server:
> 
> Initialization exception :
> java.io.IOException: expected 2 bytes, got EOF after 0 bytes
>         at com.ericsson.otp.erlang.AbstractConnection.readSock(AbstractConnection.java
> :861)
>         at com.ericsson.otp.erlang.AbstractConnection.read2BytePackage(AbstractConnection.java:1037)
>         at com.ericsson.otp.erlang.AbstractConnection.recvChallengeReply(AbstractConnection.java:1186)
>         at  com.ericsson.otp.erlang.AbstractConnection.doAccept(AbstractConnection.java:875)
>         at com.ericsson.otp.erlang.AbstractConnection.<init>(AbstractConnection.java:153)
>         at com.ericsson.otp.erlang.OtpConnection .<init>(OtpConnection.java:63)
>         at com.ericsson.otp.erlang.OtpSelf.accept(OtpSelf.java:177)
>         at server.main(server.java:39)
> 
> -----> In the erlang client
> 
> ()1> client:call().
> Init...ok
> ** exited: {{},
>             {gen_server,call,
>                         [{},
>                          rmod_random_produce,
>                          infinity]}} **
> 
> =ERROR REPORT==== 26-Oct-2006::20:02:42 ===
> Error in process <0.41.0> on node '' with exit value:
> {badarg,[{erlang,list_to_existing_atom,[""]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}
> 
> ********************************
> 
> However, I can get communication between the java client and server
> (and it is supposed that they act as erlang nodes). I think it is some
> problem with the type conversion. I am using the Erlang last release
> (R11B-1).
> Does anybody know something about it, or how to solve the problem?
> 
> Thanks
> 
> -- 
> Pablo Álvarez Yáñez
> http://azulneon.blogsome.com
> 
______________________________________________________________________

 does atom '' already exist ? 

 From the reference manual ...

"
  list_to_existing_atom(String) -> atom()

  Types:

  String = string()

  Returns the atom whose text representation is String, but
  only if there already exists such atom.

  Failure: badarg if there does not already exist an atom whose
  text representation is String. 
"

~Michael



More information about the erlang-questions mailing list