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

    JNDIServer and rmiregistry

    noky

      Hi,

       

      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)

       

      Thanks,

       

      Mike

        • 1. Re: JNDIServer and rmiregistry
          noky

          Anyone?  Can JNDIServer be used as a dropin replacement for rmiregistry?  This doesn't seem to work, unless there is some configuration piece that I am missing.

          • 2. Re: JNDIServer and rmiregistry
            jaikiran

            Mike, since the JNDIServer class appears to be HornetQ specific, I'll move this to the HornetQ forum. Someone there might be able to help.

            • 3. Re: JNDIServer and rmiregistry
              timfox

              HornetQ doesn't actually use JNDI, it has zero dependencies on it.

               

              JNDI is however provided as an extra service in the HornetQ standalone config - this is just a convenience as many users will also want to use JNDI.

               

              The JNDI service shipped with HornetQ standalone is just the same JNDI service from JBoss AS, it's not code that was written by the HornetQ team.

              • 4. Re: JNDIServer and rmiregistry
                timfox

                The JNDIServer class is not HornetQ specific, it's part of the AS, not HornetQ

                 

                Full class name is org.jnp.server.Main.JNDIServer

                 

                It comes from the jndi jar from the JBoss distro