5 Replies Latest reply on Nov 1, 2008 8:36 PM by ron_sigal

    Remote Classloading

    bbb321

      Hello

      I'm trying to something like the command pattern, and send a command from the client to the server where the command will be executed using services defined on the server.

      Of course when I receive the command on the server I get ClassNotFound exception, because the code is defined only on the client.

      Is it possible to use remote classloading for this case? The class provider should be on the client.

        • 1. Re: Remote Classloading
          ron_sigal

           

          "bbb321" wrote:

          Is it possible to use remote classloading for this case? The class provider should be on the client.


          As of Remoting 2.x, remote classloading is supported in the server to client direction only. It will be supported in both directions in Remoting 3.

          • 2. Re: Remote Classloading
            bbb321

            Thanks for the reply!

            I tried to use the reverse, and get commands from the server to the client, but without having them initialy on the client.

            I've read the "Remote classloading facility" in the JBoss Remoting Guide, but I did not get it :(

            The only thing that I could do is to set my own un-marshaller for the client with a custom class loader. What should I in that class loader? Connect to a loaderport on the server? It's done automaticaly?

            Could you please give me some directions?

            • 3. Re: Remote Classloading
              ron_sigal

              If you set "loaderport" on the server, it will create a special purpose server that can be queried for classes. If you set "loaderport" on the client, the built-in classloader will attempt to contact that special purpose server if it can't find a class locally. If you put "loaderport" in the InvokerLocator, both the client and the server will see it.

              You don't need a custom classloader or custom unmarshaller.

              • 4. Re: Remote Classloading
                bbb321

                Thanks! It worked. I was complicating things too much.

                • 5. Re: Remote Classloading
                  ron_sigal

                  Glad to hear it.