users@glassfish.java.net

Re: javax.naming.CommunicationException on jndi lookup

From: <glassfish_at_javadesktop.org>
Date: Tue, 06 Jan 2009 01:09:42 PST

Hi,

I got it working and wish to publish it, so that anyone who has this problem can get it sorted easily.

This thread was useful
http://forums.java.net/jive/thread.jspa?messageID=225734&#225734

The problem was that the application server's client jar was file was not present in my remote client. Application servers have a client jar file, that is intended for use of client applications of the Appserver.

For Glassfish 9.1 update 2, it is appserv-rt.jar. If our client make use of the packages such as the context factory implementation, we have to embed the jar that has this implementation. As soon as i entered the jar, the context factory implementation (com.sun.enterprise.naming.SerialInitContextFactory) was found and the 'irritating' error of NameNotFoundException or NoInitialContextException were sorted.

Besides, it is possible to specify just the no-args construction of InitalContext and the jar is capable of using its preferred ContextFactory.

Good luck!

Regards,
Rajesh
[Message sent by forum member 'rajesh_s' (rajesh_s)]

http://forums.java.net/jive/thread.jspa?messageID=324232