Hi Saran,
So my question is how the one for POJO failed and the same worked for a web application?Is it something related to the server container??
This kind of errors might happen when the environment for local (remote) clients is not properly set. Good examples are the
java.naming.provider.url and the
java.naming.factory.initial environment variables. The server always initializes these properties when starts up, while local clients need to set them explicitly when initializing the naming context. Hence the next code:
Works very well within a
jsp or
servlet deployed to the app server (the
ejb container and the web server are collocated), but will fail with a remote client. The problem could be easily solved:
If these two properties are not set at all you�ll get a very specific messages that clearly indicates this fact. In your case I believe that the POJO reads the properties from the local server, but tries to access a remote location. A code similar to the one above might solve your problem.
If this doesn�t work,
you should probably post the client code as well.
Regards.