This discussion is archived
1 Reply Latest reply: Jun 10, 2012 12:40 AM by EJP RSS

javax naming CommunicationException

919081 Newbie
Currently Being Moderated

I am calling an interface from my client ( simple java) from eclipse.


package ejb.client;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import ejb.interfaces.AreaRemoteBI;

public class Client { 

public static void main(String[] a) { 

Object ref = null;

Context ctx;
try { 
ctx = getInitialContext();
ref = ctx.lookup("AreaBean/remote");
} catch (NamingException e) { 


AreaRemoteBI biCall = (AreaRemoteBI)ref;
String result = null;
result = biCall.searchArea("IND");
System.out.println("\n The resul is:::"+result);


public static Context getInitialContext()
throws javax.naming.NamingException

Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
properties.put(Context.PROVIDER_URL, "jnp://localhost:1099");
properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");

return new InitialContext(properties);


I kept my remote interface in the same package of client ( client side). placed at the root folder of client...

I have both local and remote in the serverside. The local and remote interfaces, bean and entity have been bundled in a jar and deployed in JBOSS.

Now when I run my client as java program i am getting following exception

javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: com.oic.hcs.interfaces.area.AreaRemoteBI (no security manager: RMI class loader disabled)]
at org.jnp.interfaces.NamingContext.lookup(
at org.jnp.interfaces.NamingContext.lookup(
at javax.naming.InitialContext.lookup(Unknown Source)
at ejb.client.Client.main(
Caused by: java.lang.ClassNotFoundException: com.oic.hcs.interfaces.area.AreaRemoteBI (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at java.rmi.MarshalledObject.get(Unknown Source)
at org.jnp.interfaces.MarshalledValuePair.get(
at org.jnp.interfaces.NamingContext.lookup(
... 3 more
Exception in thread "main" java.lang.NullPointerException
at ejb.client.Client.main(

Please help....


  • Correct Answers - 10 points
  • Helpful Answers - 5 points