java rmi 传递对象_java rmi传递ImageIcon对象

我在做一个rmi client server based program这是假设pass Image object through remote object interfaces。客户端从服务器接收图像。

以下是我的代码....

在客户端

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;在服务器

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现在,其实我并没有太多的想法。

我有两个主要的疑问是......

是否有可能通过rmi发送ImageIcon对象...?如果是的话,这里可能是错误的。如果没有,是否存在任何通过rmi传递基于图像的对象作为参数的简单方法...?

我也听说javax.swing.ImageIcon是串行的,但在我的情况下不会发生

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值