File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes New to RMI; question of suitability for use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "New to RMI; question of suitability for use" Watch "New to RMI; question of suitability for use" New topic

New to RMI; question of suitability for use

Charles McGuire
Ranch Hand

Joined: Jan 18, 2005
Posts: 99
Hi -

I've got a Tomcat Server (container) that sits on the other side of our company firewall. It needs information from a database that sits on the inside of the company firewall. I have another Tomcat server on the inside of the firewall.

Rather than supply the outside-the-firewall server with the info to access our database, I'm thinking that RMI to the other server, which would do the DB accessing, would be more secure. Is that true, and is RMI the best way to do this or should I be considering an alternative?

On another, completely unrelated note, Peter, check your private messages.
[ October 28, 2007: Message edited by: Charles McGuire ]

There's no place like
Nitesh Kant

Joined: Feb 25, 2007
Posts: 1638

As far as i understood. You wanted to make a call from one Tomcat server to another. isnt?
I assume you will have a servlet on the tomcat server sitting behind the firewall that will do the DB processing. If so, why do you need RMI? You can directly call the servlet with appropriate parameters. Correct me if i have mistaken the problem.

apigee, a better way to API!
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Getting data through firewalls using HTTP sounds like SOAP or XML-RPC to me. Why are you even thinking of RMI?

Pat Farrell

Joined: Aug 11, 2007
Posts: 4659

I agree with William, don't use RMI, you can't reliably get thru firewalls. Even if it works, it may stop when some new network admin changes the firewalls.

I recommend REST over SOAP and others.
Johnny Kewl

Joined: Apr 16, 2007
Posts: 8
You need a POJO Application Server

It runs on Tomcat, so thats no problem.

You place it on the Tomcat inside the firewall.
You write a class that talks to the dB and drop it into the POJO App Server.

In the outside TC you
yourClass = loadRemoteClassInst("")
String theName = yourClass.getNameInDb(); //etc etc

Literally... enjoy!

Oh.. POJO applications servers "RMI" on HTTP... no firewall problem.
I agree. Here's the link:
subject: New to RMI; question of suitability for use
jQuery in Action, 3rd edition