The runtime system reports errors in using JNDI as a subclass of NamingException. The exceptions most likely to occur for accessing the initial context are as follows:
javax.naming.CommunicationException: Can't find SerialContextProvider
This exception usually means the JNDI Server is not running, or possibly the JNDI properties for the server are incorrect (see the next section, “Defining the JNDI Service”).
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java .naming.factory.initial
This exception ...