• Post Reply Bookmark Topic Watch Topic
  • New Topic

A couple of RMI questions

 
Gary Bryan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been trying out a RMI chat client and server which I got from a site, and I plan to adjust it a bit. The site was WebMonkey.
I was wondering if I would be able to run a server from my computer, on which I have a dial-up connection, and run the client from a friend's house by finding out my IP address and getting my friend to type it in to his computer, so the client connects to it (or something like that). I tried that and I got an exception that said:
Server error:
java.rmi.ConnectException: Connection refused to host: [host62-7-118-194.btinternet.com:1099]; nested exception is:
java.net.ConnectException: OpenTransport error -3260; connection refused
This seems to mean that my ISP won't let me do this. Is there another way? I have been able to use ServerSockets and Sockets without any problems.
[This message has been edited by Gary Bryan (edited March 06, 2001).]
 
Mark Savory
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm assuming that you and your friend are both on the same network(the internet). You say that you've successfully used sockets to connect to your friend's computer, so you must have picked a particular port # that both the client and server use. If you haven't already done so, make sure that the client and server are referencing the same IP and port.
 
davidlong
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also assuming the IP address you gave your friend is your computer IP, not the your ISP IP, from your post, it looks like you used your ISP's IP.
For how to find your persional computer IP, your can use MS netmeeting(help menu: about), or other tools. Note: every time you sign up internet, your ISP reassigns you a new IP.
For other things, you may check your friend if his JVM has setup a security to refuse him use the socket connection which is greater than 1024. meak sure he get all permissions.
hope this help.

David
 
ram mohan
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi davidlong,
I have a question to ask u.
U mentioned that the JVM may have the security setup to refuse the use the socket connection which is greater than 1024.How to find out whether there is any setup like that?If so how to modify that?
Rgds
Ram
 
Gary Bryan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found out my IP address by going to the TCP/IP control panel on my computer, and it wasn't the same one that came up on "connected to:" on the dial-up program. I also used the BT Internet website, which tells you your IP address ( http://www.btinternet.com/new/content/mybti/ip_address.shtml ).
I also thought that RMI automatically used the port 1099. When I have used sockets before, I used other ports (like 4444, 666, 1405, etc.), so I thought it could be that particular port that doesn't work.
I haven't got to the stage of trying the client at a friend's house, because I can't get the server to start.
 
Ashwin Desai
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gary,
Did you use a security policy file when starting your server ?
You need to give the proper permissions to your application to listen/receive etc from sockets. Use this generic policyfile

Also, if the client is using dynamic stub downloading, there needs to be a RMISecurityManager setup at the client side.

Start the server using the policy file as follows :

Hope this helps.
AShwin.
[This message has been edited by Ashwin Desai (edited March 08, 2001).]
 
davidlong
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ram
the JVM security policy file resides in
yourjdkhomedirectory/jre/lib/security/java.policy, which is a pure text file. try to add following as one line to this file:
permission java.net.SocketPermission "*:1024-65535", "connect, accept";
but i really think your problem is wrong IP address to be used.
David
 
Gary Bryan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found out that the problem was that I hadn't started rmiregistry running. The tutorial on Webmonkey didn't mention anything about rmiregistry. It also didn't mention making stub and skeleton classes, which took me a while to work out.
Anyway, I seem to be having another problem. I get an exception which says it can't find the stub file (GBChatServer_Stub.class) which does exist. I have checked the class path and everything.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!