File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Help with InitialContext!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help with InitialContext!!" Watch "Help with InitialContext!!" New topic
Author

Help with InitialContext!!

Saiprasad Natarajan
Greenhorn

Joined: Oct 27, 2010
Posts: 12

Hi

Does InitialContext() initialize a context to the server where the calling application is deployed?

And if i need the JNDI look up to happen at the current server itself, would new InitialContext() suffice or do i need to specify the environment also?

TIA
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

InitialContext always needs the properties to be set, but if you look at the javax.naming.Context API there are multiple ways to specify these properties.
You can define them explicitly and pass them to the constructor, otherwise (as in your case) the default values can be defined as environent variables or as a resource file (on the file system)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with InitialContext!!