I successfully deployed a session bean with both iiop and jnp invoker. In the client, with using jnp, everythings work fine but when using iiop, PortableRemoteObject.narrow() return a null object. Once I put the stub class in the client class path, it works fine. Seems the dynamic downloading of the stub isn't working for iiop.
Here's the client code:
InitialContext context = new InitialContext(env);
Object staHomeObj = context.lookup ("myTest/Status");
StatusHome staHome = (StatusHome)javax.rmi.PortableRemoteObject.narrow( (org.omg.CORBA.Object)staHomeObj, StatusHome.class);
I have the following jar included in the client class path:
With the following client.policy:
I also inspected the staHomeObject ior string using jacorb's dior, which is matched to the one when jboss startup with the following java code base:
Is anything I have been missed?
Are you starting the IIOP client with "-Djava.security.manager" and "-Djava.security.policy=path_to_your/client.policy"?
These command-line switches are not necessary in the non-IIOP case, but you need them for RMI over IIOP.