Java RMI передачи объектов ImageIcon

Я делаюrmi client server based program что предполагаетсяpass Image object through remote object interfaces. The Client receives an Image from the Server.

Ниже мой код ....

At Client

       public class ImageReceiver
       {
                  public static ImageIcon imageicon;

                  public static void main(String Data[])
                  {

                         imageicon = new ImageIcon(url);
                         imageicon=remoteObject.getImageFromServer();
                  }

        }
        // The Details regarding the binding of remote objects are excluded since they are worling fine...

sendImage - реализованный метод взаимодействия

        public ImageIcon getImageFromServer() throws RemoteException;

At Server

           public ImageIcon getImageFromServer()
           {
                  ImageIcon ic = new ImageIcon("local url specified");
                  return ic;
           }

         // Much of the Exceptions and other binding details are excluded for simpicity.....

Теперь проблема в том, что я получаю сообщение об ошибке

          java.rmi.UnmarshalException: error unmarshalling return
          nested exception is: java.io.EOFException               

Теперь, на самом деле, я понятия не имею, как это произошло ... У меня есть два основных сомнения:

Is it possible to send ImageIcon objects through rmi...?? If yes, What could be probably the mistake here. If not, does there exist any simple way to pass Image based objects as parameter through rmi...??

I've also heard somewhere that javax.swing.ImageIcon is serial....but it's not happening in my case

Ответы на вопрос(1)

Ваш ответ на вопрос