This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "RMI" Watch "RMI" New topic


saravanan palanivel

Joined: Sep 05, 2012
Posts: 9
Hi ,
I'm new to java. I trying RMI concept in jsp. in that i defined the server and client as method where we can pass parameter host name and port.
when i invoking the server and client method from another jsp it works fine for first time. but when invoking second time it says
"remote exceptionjava.rmi.server.ExportException: Port already in use: 3232; nested exception is: Address already in use: JVM_Bind
I dont know how to resolve it , please give some ideas...

Thanks in advance...
Joe Ess

Joined: Oct 29, 2001
Posts: 8836

Welcome to the JavaRanch. It's a good idea to show us your code and indicate where the error occurred so we have some idea as to what you are doing (see our FAQ: HowToAskQuestionsOnJavaRanch)
My wild guess would be that you are invoking Registry.bind() more than once. Once bound, a remote object is available until it is removed from the registry with a call to unbind().
And why would you mix RMI with servlets?

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

saravanan palanivel wrote:when i invoking the server and client method from another jsp it works fine for first time. but when invoking second time...

That appears to say that you are starting the RMI server from a JSP. Is that really true? It sounds to me like an extremely strange way to run a server. And if it is true, then naturally starting the server a second time, when it is already running, is going to lead to that error message.
Consider Paul's rocket mass heater.
subject: RMI
Similar Threads
NX: RMI check available port or host number
Running RMI registry on ramdon port
port field
Callbacks in RMI and Corba
RMI Connection Refused after some clients connected successfully