JBOSS7 - Remote lookup is failing
mou_gc Nov 19, 2013 6:40 AMHi all,
We are trying to create two RMI objects and using a helper bean binding these to the JNDI naming service of standalone container in JBOSS AS7, with reference "CLI" and "SM". Although the bind goes through fine, the lookup fails for "CLI" with the following error message -
javax.naming.NamingException: Unable to invoke lookup, status=WAITING
at org.jboss.naming.remote.protocol.v1.Protocol$1.execute(Protocol.java:98)
at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.lookup(RemoteNamingStoreV1.java:78)
at org.jboss.naming.remote.client.HaRemoteNamingStore$1.operation(HaRemoteNamingStore.java:227)
at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:114)
at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:223)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
The lookup for "SM" succeeds though. The code snippet for the lookup -
private static Properties jndiprop = new Properties();
jndiprop.put("java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory");
jndiprop.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
jndiprop.put("java.naming.provider.url", "remote://" + java.net.InetAddress.getLocalHost().getHostAddress() + ":"+port);
initialcontext = new InitialContext(jndiprop);
o = initialcontext.lookup(lookupString);
where lookupString takes the vales "SM" and "CLI".
The binding is done by a helper bean deployed in the container as follows -
private String JBOSS_CONTEXT = "java:jboss/exported";
InitialContext ctx = new InitialContext();
String contextStr = JBOSS_CONTEXT + "/" + context; //context is either SM or CLI
ctx.rebind(contextStr, object);
Can anybody please guide on what could be the possible reason behind this exception?
Thanks in advance.
Regards,
Mou