Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 1141
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,
Let's go to the waterfront with this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!