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 Beginning Java and the fly likes Regarding NamingException 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 » Beginning Java
Bookmark "Regarding NamingException" Watch "Regarding NamingException" New topic
Author

Regarding NamingException

Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Hi All,

Could anyone explain me when NamingException is thrown?


I searched on the internet. I got an explaination as below:

This is the superclass of all exceptions thrown by operations in the Context and DirContext interfaces. The nature of the failure is described by the name of the subclass.



But not much cleared. i have no clue abouot what Context and DirContext interfaces do. Could anyone please explaned me with snippet which throws above exception.

Thanks in Advance.

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2231
    
    7

Have you looked under javax.naming.Context and javax.naming.directory.DirContext? In brief, the DirContext is for directories or folder. Context is for the object level. These interfaces and the NamingException is part of the Java Naming and Directory Interface (JNDI). Some reading on this topic will get you a bit more answers. The Java Tutorial for JNDI is here


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
Consider Paul's rocket mass heater.
 
subject: Regarding NamingException
 
Similar Threads
NamingException was thrown
How to bind() ?
JNDI related question - please help if u can
Alternative strategies for authenticating against LDAP w/ JNDI
problem while creating InitialContext .....