[jboss-user] [Remoting] - Re: rmi registry
choozie
do-not-reply at jboss.com
Mon Jul 24 04:58:11 EDT 2006
I figured out my mistake, but I've run into another one. My code is the following:
if (System.getSecurityManager() == null){
System.setSecurityManager(new RMISecurityManager());
}
Properties env = new Properties();
env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.setProperty("java.naming.provider.url", "localhost:3455");
env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
try {
InitialContext context = new InitialContext(env);
} catch (NamingException e) {
e.printStackTrace();
}
try{
InvokerLocator myLocator = new InvokerLocator("rmi://localhost:3455");
RMIServerInvoker rmiserver = new RMIServerInvoker(myLocator);
}catch(Exception e){
e.printStackTrace();
}
No errors so far. But then I try to bind to the registry, with
Naming.rebind( serverUrl, server );
where serverUrl = rmi://localhost:3455/
and server is a UnicastRemoteObject.
This gives
RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: <server-class>_Stub
I checked the class-folder, and the stub is there. If I create a local rmi-registry and bind to that (skipping all the above code expect the naming.rebind), everything works fine. But I would like the use the jboss rmi registry. What am I doing wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960269#3960269
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960269
More information about the jboss-user
mailing list