jinterface questions

Per Bohlin <>
Mon Dec 20 10:10:42 CET 1999


I tried to experiment a little bit with
JInterface starting with making a hidden connection 
from a Java node to an Erlang Node.

When doing this with the open source distribution
on my Home-PC with Windows 98
and JDK 1.2 downloaded from javasoft.com
I did not succeed.

The erlang side refuses to accept the connection.
Error printout: ** Connection attempt from disallowed node ... 
 
On the Java side I get an authorization exception

I have found that there are some handshaking going on where 
a random number is sent from Erlang to Java. Some calculations
are made on this number on both sides. The result is sent from Java to
erlang and the results are compared. 
They are not identical so Erlang stops the connection.

Doing the same thing at work with OTP-R6 on Sun/Solaris
works fine.
 
I have now patched both dist_util.erl in the kernel source and 
OtpConnection.java in jinterface so that the tests are avoided. 
This seem to work, but I guess that is not the way to solve it.
What shall I do to make it work properly? 
 

I also have a question about the functionallity of JInterface.
At first I thought that it provided the same functionallity to JAVA
that you get to C when using erl_interface.

I've used erl_interface a bit in a User Interface tool where
C++ objects are represented with Erlang PID's. 
When receiving messages from erlang a dictionary is used to keep
track of which object to transfer the message to based on the pid
that the message is sent to. So effectivly the erlang side can send 
messages to C++ objects (represening windows) 
as if they where Erlang processes.

In JInterface it is possible to create Erlang PIDs on the java side.
But, I have not found any way of getting the PID that the Erlang message 
was sent to. The messages just ends up in the
OtpConnection.receive
without reference to the PID that the message was sent to.

Is there a way to find the PID that the message was sent to?
(And possibly also the PID of the process that the message was sent
from,
I don't need it but it is there in erl_interface)

Thanks

/Per Bohlin

PS. I am new to this mailing list. Sorry if this has been discussed
before DS.



More information about the erlang-questions mailing list