5 Replies Latest reply on May 21, 2002 5:03 PM by Adrian Brock

    no security manager: RMI class loader disabled

    Edson Newbie

      This error occurs when a method returns a (valid) value object. This method is inside the SessionBean.
      I don´t understand this error because the code is correct.

      I really apreciate answers.

      Thanks.

        • 1. Re: no security manager: RMI class loader disabled
          Adrian Brock Master

          You are returning a class that is not on the client.
          You have two choices.
          1) Put the class in the client's classpath
          2) Configure an RMISecurityManager to download the
          class from the server.

          Regards,
          Adrian

          • 2. Re: no security manager: RMI class loader disabled
            Edson Newbie

            Adrian,

            The problem is that I'm returning an interface not an implementation. The interface is known to the client while the implementation isn´t. The interesting part is that if I include the implementation class with in the jar of the bean it works (while never using it directly in code). Do you have any other ideas? Why would the bean need access to the implementation class? Doesn't RMI cast the deserialized object to the type of the interface directly without the implementing class on the classpath?

            Regards,
            Edson

            • 3. Re: no security manager: RMI class loader disabled
              Adrian Brock Master

              Don't get confused between what the compiler sees
              and what the VM sees.

              At compile time (and for casting) you are using the
              interface.
              But it is the implementation's that is
              executed, you need the byte code from the class.

              Of course if this was a remote object the implementation
              wouldn't be passed to the client, only the proxy or stub.

              Regards,
              Adrian

              • 4. Re: no security manager: RMI class loader disabled
                Edson Newbie

                Adrian, thanks for helping. The problem is still not solved. My idea of the RMI is something like the following.
                Serializing an object will save the non-transient variables of the instance and send it to the destination host as bytestream. As you said, the implementation will not be present and the JVM will try to load the implementation from somewhere. I belive there is a server at jboss that the classloaders connect to to download the class files or are there any other way for the RMI to provide the implementation transparantly. With transparantly I mean not putting the implemenation class in the jar nor in the jboss classpath. (By the way, the interface is public and the implementing class is package private).

                Thanks again.
                Regards,
                Edson

                • 5. Re: no security manager: RMI class loader disabled
                  Adrian Brock Master

                  To download classes from the server you need to
                  configure an RMISecurityManager in the client.

                  Have a look at the javadocs for that class
                  or the RMI manual.

                  Regards,
                  Adrian