I get confused by the jndi "directory" part but suspect that one
problem is your use of InitialDirContext rather than InitialContext.
Also are you sure you are using the openejb client library that goes
with the server? While we've tried to keep compatibility with older
versions there may have been some changes in the authentication
bits.... I know there were in the code if not the protocol.
thanks
david jencks
On Apr 7, 2008, at 11:20 PM, Mohammad Shamsi wrote:
Hi All,
in Gmo 2.1, i want to lookup a EJB from a standalone client
i write this code :
Properties environment = new Properties();
environment.put("java.naming.factory.initial",
"org.openejb.client.RemoteInitialContextFactory");
environment.put("java.naming.provider.url", "localhost:4201");
try {
InitialContext context = new InitialDirContext
(environment);
Object o = context.lookup("SampleBean");
but i got this exception :
javax.naming.AuthenticationException: Cannot read the response from
the server (OEJP/2.0) : null; nested exception is:
java.io.OptionalDataException
at org.openejb.client.JNDIContext.authenticate(JNDIContext.java:
196)
at org.openejb.client.JNDIContext.getInitialContext
(JNDIContext.java:181)
any idea ?
--
sincerely yours
M. H. Shamsi