RMI的这种错误是什么意思?怎么回事?

kesney 2003-05-06 08:37:01
问题1:
java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.io.NotSerializableException: alb_rip.Ralbrip

at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)

at alb_rip.Ralbrip.main(Ralbrip.java:302)

Caused by: java.io.NotSerializableException: alb_rip.Ralbrip

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)

... 2 more


其中提到的错误所对应的代码是:
.....
Ralbrip rip = new Ralbrip(); //实例化远程类
LocateRegistry.createRegistry(2002);
Registry registry = LocateRegistry.getRegistry(2002);
registry.rebind("albripServiceObj", rip); //注册一个远程类
Naming.rebind("//localhost/albripServiceObj", rip);
.....


问题2:
我的rmi程序在Jbuilder下面经常出现如下警告,为什么?
"Ralbrip_Skel.java": Warning #: 368 : interface java.rmi.server.Skeleton in package java.rmi.server has been deprecated at line 7, column 32
"Ralbrip_Skel.java": Warning #: 368 : class java.rmi.server.Operation in package java.rmi.server has been deprecated at line 9, column 42
"Ralbrip_Skel.java": Warning #: 368 : class java.rmi.server.Operation in package java.rmi.server has been deprecated at line 17, column 28
"Ralbrip_Skel.java": Warning #: 368 : interface java.rmi.server.RemoteCall in package java.rmi.server has been deprecated at line 21, column 63
"Ralbrip_Skel.java": Warning #: 368 : class java.rmi.server.Operation in package java.rmi.server has been deprecated at line 10, column 22
"Ralbrip_Skel.java": Warning #: 368 : constructor Operation(java.lang.String) in class java.rmi.server.Operation has been deprecated at line 10, column 22

这似乎和SecurityManager有关,请指点!谢谢!!
...全文
936 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
kesney 2003-05-10
  • 打赏
  • 举报
回复
谢谢wangjingjing390
wangjingjing390 2003-05-10
  • 打赏
  • 举报
回复
告诉我你的邮件
kesney 2003-05-09
  • 打赏
  • 举报
回复
焦急地等待中1
kesney 2003-05-07
  • 打赏
  • 举报
回复
出现了新问题!!!

我在Cmd下面手动编译,就没什么问题。但是在jbuilder8下面就不行了。

这是为什么?在jbuilder8下面有一个rmi的参数行,这是是什么?
jxspace 2003-05-07
  • 打赏
  • 举报
回复
如果,那个东西不在你控制的范围,那么,你就无法让它序列化了(纠正,最好不要叫串行)。有必要要把jdbc:odbc的东西序列化么?我看未必需要,把你想要的东西重新打包组织一下,序列化后返回,这么解决才对。
kesney 2003-05-07
  • 打赏
  • 举报
回复
自己往上顶一下!
see1230 2003-05-07
  • 打赏
  • 举报
回复
需要实现吗?? 直接在你的需要序列化的类上加入 implement Serializable
就可以了
Serializable 是一个空方法标志接口 完全不需要你去实现他什么东西 java 语言本身已经很好的实现了序列化的功能
kesney 2003-05-07
  • 打赏
  • 举报
回复
upup!

自己re一下,希望大家帮助我!

kesney 2003-05-06
  • 打赏
  • 举报
回复
up!up!

那么我如何实现这个java.io.Serializable接口呢?

现在我发现,问题出在我的一个方法中涉及到了jdbc:odbc的东西,系统报错说这个东西不能串行化。我怎么才能让它们串行化呢?

谢谢了!
theninthsky 2003-05-06
  • 打赏
  • 举报
回复
问题1:
对MarshalException的介绍
public class MarshalException
extends RemoteException
A MarshalException is thrown if a java.io.IOException occurs while marshalling the remote call header, arguments or return value for a remote method call. A MarshalException is also thrown if the receiver does not support the protocol version of the sender.

If a MarshalException occurs during a remote method call, the call may or may not have reached the server. If the call did reach the server, parameters may have been deserialized. A call may not be retransmitted after a MarshalException and reliably preserve "at most once" call semantics.
littlecong 2003-05-06
  • 打赏
  • 举报
回复
警告应该没有影响的
出问题的应该是alb_rip.Ralbrip,它不能Serialize,可能需要实现serializable节口

62,629

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧