4 Replies Latest reply on Mar 22, 2010 1:25 PM by Tim Fox

    JNDIServer and rmiregistry

    Mike Charnoky Newbie



      I'm new to JBoss and am currently evaluating HornetQ 2.0 in a J2SE (not J2EE) environment.  Our software makes use of RMI, so we are running the standard Java rmiregistry on our servers (bound to port 1099).


      Now, HornetQ makes use of JNDI.  The standard HornetQ configuration (hornetq-beans.xml) starts up the JNDIServer bound to ports 1099 (JNDI) and 1098 (rmi).  I naively figured that I could shut down the rmiregistry and reconfigure JNDIServer to use port 1099 for rmi services.  However, this does not seem to work: when our software performs a java.rmi.Registry.rebind(), the action fails:


      java.rmi.NoSuchObjectException: no such object in table
              at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
              at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
              at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
              at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)


      I have been doing a lot of searches trying to get to the bottom of this with no luck... what am I missing here?  Can the JNDIServer function as a replacement for rmiregistry?  This would certainly simplify things, as we would no longer need to run both JNDIServer and rmiregistry.


      If this is not possible, I guess I will just run rmiregistry and JNDIServer in parallel, using different ports for JNDIServer (eg: 11098 and 11099)