I m making an rmi client server based program
which is suppose to pass Image object through remote object interfaces
. The Client receives an Image from the Server.
Following is my code....
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 is an interfacing method implemented...
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.....
Now the problem is, i m getting an error called
java.rmi.UnmarshalException: error unmarshalling return
nested exception is: java.io.EOFException
Now, Actually i don't have much of any idea how it came... The two major doubts I have is....
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
The same problem occured...when i tried to pass ImageIcon object through RMI....
After a long checking....i found the url i specifed was incorrect.....
it happens...the complier in this often shows Unmarshall exception exactly as you shown.......
try checking your local URL.....