[Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:652)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at chap2.chat.Chat.<init>(Chat.java:25)
at chap2.chat.Chat.main(Chat.java:98)
You will have to place the jar containing the com.sun.jndi.fscontext.RefFSContextFactory class in the classpath of your client application (the chap2.chat.Chat application)