Title: RE: [JBoss-user] How to Look up a remote Object via JNDI

In JBoss, If i create an object and put it into JNDI like this, how do i lookup and get a reference to that object from a remote machine..

Here's how i'm binding the object...


ServiceSettings ss = new ServiceSettings();
ss.setUid("bob");

Context ctx = new InitialContext();
ctx.bind("SETTINGS", ss);




ON THE REMOTE MACHINE (with jndi.properties pointing to the jboss server)
I wanted to do this but apparently this does not work because it will throw
a ClassCastException because a different JVM created the object.

Context ctx = new InitialContext();
ServiceSettings ss = (ServiceSettings) ctx.lookup("SETTINGS");

Does anyone use JNDI to store objects that need to get
used by remote servers (JVM's).  These objects are NOT EJBs.  Just plain-old
objects.   Or, is JNDI not meant for making objects available to remote JVMs
like this?

thanks!

Reply via email to