This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes Should I use Naming or InitialContext to bind my server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Should I use Naming or InitialContext to bind my server?" Watch "Should I use Naming or InitialContext to bind my server?" New topic
Author

Should I use Naming or InitialContext to bind my server?

Stevens Miller
Ranch Hand

Joined: Jul 26, 2012
Posts: 523
    
    3

I have an rmiregistry process running when I execute the main method in this class:


It works perfectly.

This code also works perfectly:


They are the same, except for Line 19. Using the debugger as far as I can, I don't see that these two classes (InitialContext and Naming) rely on the same code, yet (in this application) they do very similar things.

Why are there two ways to bind a registry entry to an object?

What, if anything, would make one preferable to the other?
 
Consider Paul's rocket mass heater.
 
subject: Should I use Naming or InitialContext to bind my server?