Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

problem using RMI

  Asked By: Anita    Date: Mar 03    Category: Java    Views: 904
  

I have a problem using RMI. It give me the error below when I try to
connect to the RMI server from own terminal inside a LAN.

Invoke Remote process
InvokeAmtrixClient: java.rmi.ConnectException: Connection refused to
host: [kmch
ong:1099]; nested exception is:
java.net.ConnectException: Connection refused

I have suceesfully run the rmiregistry, up the server.

But now when I try to connect the server using clinet on own
terminal,it fails.

I still need to stick to Java 1.1.x, can anyone of you guy which
have tried RMI before able to give me some tips

I think is possible the port was blocked, then how to unblock it, Can
I offset within JVM or it's OS domain ?

I have read article regarding this issue, too bad it's all for Java2

Can I do the same in Java1, but I found some of the API is missing in
Java1.

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Lenora Green     Answered On: Mar 03

Check if the RMI port is blocked by an Firewall proxy.
Contact your Networkk Admin for further information.
Secondly set the security policies for Socket
connections by using the policy tool. The file that
need to be changes is your "java.policy" file

 
Answer #2    Answered By: Ryan Evans     Answered On: Mar 03

I will try to consult my network administrator regarding the port,

But What I do now is I invoke

For Remote server, I run
java -Djava.security.manager -Djava.security.policy=java.policy
RMITest.InvokeServer

The server  java.policy I include line
permission java.net.SocketPermission "Server
IP:1099", "accept,connect";

permission java.net.SocketPermission "localhost:1099-
", "accept,connect,listen";

I run on my pc :
java -Djava.security.manager -Djava.security.policy=java.policy
RMITest.InvokeClient

My client java.policy
permission java.net.SocketPermission "<Server
IP>:1099", "accept,connect";

 
Answer #3    Answered By: Aamanee Khan     Answered On: Mar 03

The socket should also be allowed to be resolved.
Please make the corresponging changes to both the
Server and Client RMI components. Can you do that and
check it?

Also make sure that both the server  and Client classes
are complied using the same JDK version. I ran into
some trouble when I was setting up an Intranet Demo
Chat applications using Java RMI where both the server
and client classes were executing in different JVM
versions.

 
Answer #4    Answered By: Michele Grant     Answered On: Mar 03

My client is 1.1.6(NT) and server  is 1.1.3(Sun Solaris)

I cant do things about it to make them the same at least I cant touch
the server and it's too backward to change my client to 1.1.3.

I have modified as what you suggested, but problem  remained.

I have checked with adminstrator.

No blocking and firewall for my enviroment.

Do u think is correct :
This is my client version of java.policy
permission
java.net.SocketPermission "x:1099", "accept,connect,resolve";

where x is a IP Adreess that wish to connect.

My server side : the x above

permission
java.net.SocketPermission "localhost:1099", "accept,connect,listen,res
olve";

I have to stick with java  1 where I cant find any java.polocy file,so
I create my self and put into the directory where run those RMI
clasess,

Does this compatible ?

Because i read an article that say that it's backward compatiblity.

 
Answer #5    Answered By: Aberto Rossi     Answered On: Mar 03

The policy file will be in this directory

<%JAVA_HOME%>\jre\lib\security...You will have to
modify this file alone alone on both the server  and
client...I am not positive the correct policy file is
getting loaded....

Search the JDK home directory for all the files...


Does your Solaris M/c have a dual network
interface..if so plz check if the alternative
interface is up.....

 
Didn't find what you were looking for? Find more on problem using RMI Or get search suggestion and latest updates.




Tagged: