• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
  • Carey Brown
  • salvin francis
  • Claude Moore

rmi and firewall  RSS feed

Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I haven't never studied protocol details of RMI and i don't have time for it now, so i hope that someone could help me..

I have RMI server (or is it register..) in remote host. There is two firewall between client&server. If i take telnet from client to server in RMI port, it accept connection, so connection work in that way, but client firewall don't accept incoming connections. What can i do?

I can use RMI fine in other machine, where there isn't any firewalls between this server host and client host.

I will use one RMI method, which i will call in client, and method will return byte array.

Why RMI works this way? If client create socket to server, and it is bidirectional TCP socket, why cannot RMI read inputstream, or does it work other way? is RMI ?

Thanks already!

- Artsi
[ April 08, 2005: Message edited by: Nathan Pruett ]
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is that RMI will use a variety of ports to 'talk' between the client and server after the initial connection is established. Here is a tutorial on using a custom socket factory to fix this. You could also implement RMI-HTTP Tunneling. Firewall issues in general are covered in the RMI FAQ on Sun's site under the heading 'Firewall Issues'.

However, if you just have one method and it returns a byte array, why not just use a direct socket connection?
Ranch Hand
Posts: 1142
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is possible to open a port in the firewall, for RMI communication, then your "server" object (which probably extends UnicastRemoteObject) should override the "UnicastRemoteObject(int)" constructor. See the javadocs for more details.

Good Luck,
Hot dog! An advertiser loves us THIS much:
Create Edit Print & Convert PDF Using Free API with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!