• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

error: ObjID already in use

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I occur a RMI problem, it push me into a dilemma.

When starting, application run the following code segment:
int rmiPort = 1099;
Registry reg = LocateRegistry.createRegistry(rmiPort);
reg.rebind("theRemoteObj",remoteObj);

it run well. After application start over, user change the variable "rmiPort" through UI, now application run the above code segment again, then throws the error:
java.rmi.server.ExportException: internal error: ObjID already in use

I attempt to use "LocateRegistry.getRegistry(rmiPort)" method, but it always return a non-null value even though no any Registry is created.

How to solve the problem?

Appendix: My design thought is that system allow user to change Port, server address and Database File.

best regards.
 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too had this problem, I really believe there is a limitation in the rmi implementation that prevents createRegistry in the same JVM more than once for ANY port.

After a while playing with this, I made my app start under any port, but when it was stopped, it unexport and unbind that port and closed the app.

Change port? Fine, but you have to start the JVM again.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by mike acre:
I too had this problem, I really believe there is a limitation in the rmi implementation that prevents createRegistry in the same JVM more than once for ANY port.

After a while playing with this, I made my app start under any port, but when it was stopped, it unexport and unbind that port and closed the app.

Change port? Fine, but you have to start the JVM again.



I faced the same problem as well this morning. I use the static method unexport in UnicastRemoteObject to unexport the remote object. and unbind the service. But still can not change port. recently, my program can only allow the client to use one port at once. otherwise, have to start the program again. That is really what I expected. Anyone can tell me what I can do to change port at running time? or solve the "error: ObjID already in use" problem. Thanks in advanced.

Regards,
Walter
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also get the same error...

 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by peter wooster:

I tried many different approaches to this after searching the Sun Java RMI forum on the topic. It appears that you cannot change the port once its open, you will have to shut down your server and restart after making the change. You can get past the ObjID problem, but the new registry does not work.

You could use Runtime.exec to start the registry, but that opens up a whole different can of worms.

I reread my project instructions and I can see no need to change the port, you either can create a registry on 1099 or you can get one. If you can't do either of those, then you should "contact your network administrator".

I don't actually let my server do any configuration, and it has no GUI. the only configuration available is the database file name and the user can use the standalone client GUI to configure and test this.




This reply to myself is to get the incorrectly dated reply back in order.
/pkw
 
Wickes Potgieter
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to change the RMI Registry port number during runtime?
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Wickes Potgieter:
Is it possible to change the RMI Registry port number during runtime?



I tried many different approaches to this after searching the Sun Java RMI forum on the topic. It appears that you cannot change the port once its open, you will have to shut down your server and restart after making the change. You can get past the ObjID problem, but the new registry does not work.

You could use Runtime.exec to start the registry, but that opens up a whole different can of worms.

I reread my project instructions and I can see no need to change the port, you either can create a registry on 1099 or you can get one. If you can't do either of those, then you should "contact your network administrator".

I don't actually let my server do any configuration, and it has no GUI. the only configuration available is the database file name and the user can use the standalone client GUI to configure and test this.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic