4 Replies Latest reply on Nov 29, 2004 10:57 PM by jscoobyced

    RMIRegistry problem

    jscoobyced

      Hi,

      I am using a simple RMI binding on JBoss. But I got ClassNotFound: it says it can't find the Stub class

      if (System.getSecurityManager() == null)
      {
      System.setSecurityManager(new RMISecurityManager());
      System.out.println("Setting a RMISecurityManager.");
      }
      Registry registry = LocateRegistry.createRegistry(5050);
      obj_AuthenticationManagerImpl = new AuthenticationManagerImpl();
      registry.rebind("AuthenticationManager", obj_AuthenticationManagerImpl);


      Note that the method containing this code is called from a Servlet.
      I have compiled my classes through Eclipe, and ran "rmic" from a command line.
      The WAR is created using the packager of JBoss. The WAR file contains the Stub and Skel classes.
      Is there anything I missed ?

      Thank you.

        • 1. Re: RMIRegistry problem
          jscoobyced

          Just to give mor details about the Exception:

          java.rmi.StubNotFoundException: Stub class not found: net.cedric.authentication.rmi.AuthenticationManagerImpl_Stub; nested exception is:
          java.lang.ClassNotFoundException: No ClassLoaders found for: net.cedric.authentication.rmi.AuthenticationManagerImpl_Stub

          And there are a few SecurityException as welll

          • 2. RMISecurityManager issue
            jscoobyced

            I could run the previous code and access to the remote object if I don't set the RMISecurityManager()

            So now my question is: how to set the RMISecurityManager without breaking he Security of JBoss

            Thank you

            • 3. Re: RMIRegistry problem
              starksm64

              jboss does not run with a security manager by default so your free to configure one. You can also simply include the rmi stub class in you client side jar to avoid having to use rmi dynamic class loading.

              • 4. Re: RMIRegistry problem
                jscoobyced

                Thank you for your reply. I actually had partial testing yesterday. Now it looks it's working.