no security manager: RMI class loader disabled in Jboss 3.0
843829Oct 23 2002 — edited Feb 6 2003Please Ignore my other Message(My META-INF was not in Root and now I am able to get my beans bound).
I am using Jboss 3.0
I am able to access service of my HelloWorld Session Bean through a jsp.
But not able to do so using a java client.
my directory structure is :
com\ideas\users\<Bean classes(Remote Interface,home interface,Bean)>
com\ideas\users\<Bean client(a java client)>
My java client program is :
---------------------------
import javax.rmi.*;
import javax.naming.*;
import java.util.*;
import com.ideas.users.*;
public class HelloWorld {
public static void main( String args[]) {
try{
Properties p = new Properties();
p.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
p.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
p.put("java.naming.provider.url","localhost");
InitialContext ctx = new InitialContext(p);
//Lookup the bean using it's deployment id
Object obj = ctx.lookup("users/Hello");
//Be good and use RMI remote object narrowing
//as required by the EJB specification.
HelloHome ejbHome = (HelloHome) PortableRemoteObject.narrow(obj,HelloHome.class);
//Use the HelloHome to create a HelloObject
Hello ejbObject = ejbHome.create();
//The part we've all been wainting for...
String message = ejbObject.sayHello();
//A drum roll please.
System.out.println( " run successfully and message is :" + message);
} catch (Exception e){
e.printStackTrace();
}
}
}
---------------------------
I am able to compile but when i try to Run I get the following error message
--------------------------------
javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundException: org.jboss.proxy.ClientContainer (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
at java.io.ObjectInputStream.inputClassDescriptor(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.io.ObjectInputStream.inputObject(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.io.ObjectInputStream.inputClassFields(Unknown Source)
at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
at java.io.ObjectInputStream.inputObject(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.rmi.MarshalledObject.get(Unknown Source)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:449)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
at javax.naming.InitialContext.lookup(Unknown Source)
at HelloWorld.main(HelloWorld.java:25)
--------------------------------
Please help me out .
Thanks in advance
Sujith