Hello all
I am getting error while runing the code given below. Please let me know the solution.
public class Test {
public static void main(String[] args) throws Exception {
Context context = getInitialContext();
//Object o = context.lookup("ejb/facility.root.configuration.readonly.remote");
Object o = context.lookup("ejb/facility.session.remote");
}
public static Context getInitialContext()
throws javax.naming.NamingException
{
java.util.Properties p = new java.util.Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.put(Context.PROVIDER_URL,"jnp://localhost:1099");
return new javax.naming.InitialContext(p);
}
}
I get the following error
Exception in thread "main" javax.naming.CommunicationException [Root exception i
s java.lang.ClassNotFoundException: se.ericsson.nrg.wsf.session.SessionHome (no
security manager: RMI class loader disabled)]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:668)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
at javax.naming.InitialContext.lookup(Unknown Source)
at Test.main(Test.java:13)
Caused by: java.lang.ClassNotFoundException: se.ericsson.nrg.wsf.session.Session
Home (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 java.io.ObjectInputStream.readProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.rmi.MarshalledObject.get(Unknown Source)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:5
1)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:566)
... 3 more
Thanks in advance
It looks like the home interface to the bean you have looked up is not on the classpath of the client.