免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2009 | 回复: 3

求助:关于RMI的一个小问题。困扰了我一个早上 [复制链接]

论坛徽章:
0
发表于 2006-08-19 16:40 |显示全部楼层
这是我写的一个RMI程序,在别人的机上可以运行成功,但回到我的机上就不行了。

在保证了程序编写正确,环境配置的正确,和正确配置policytool的情况下。

输入命令 :rmiregistry
出现以下提示:security properties not found. using defaults.


接着在另一个窗口中运行服务器实现类

D:\java学习资料\达内笔记\EJB笔记\8月18日\rmi>java CircleServerImpl
出现以下异常
java.rmi.ServerException: Server RemoteException; nested exception is:
        java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
        java.lang.ClassNotFoundException: CircleServerImpl_Stub
        at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
        at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
        at sun.rmi.server.UnicastRef.invoke(Unknown Source)
        at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
        at java.rmi.Naming.rebind(Unknown Source)
        at CircleServerImpl.main(CircleServerImpl.java:15)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
ception is:
        java.lang.ClassNotFoundException: CircleServerImpl_Stub
Caused by: java.lang.ClassNotFoundException: CircleServerImpl_Stub


开始我原以为是端口没有打开,接着我用netstat -a 命令测试了一下

Proto  Local Address          Foreign Address        State
TCP    yourcomputer:http      yourcomputer:0         LISTENING
TCP    yourcomputer:epmap     yourcomputer:0         LISTENING
TCP    yourcomputer:https     yourcomputer:0         LISTENING
TCP    yourcomputer:microsoft-ds  yourcomputer:0         LISTENING
TCP    yourcomputer:1033      yourcomputer:0         LISTENING
TCP    yourcomputer:1035      yourcomputer:0         LISTENING
TCP    yourcomputer:1036      yourcomputer:0         LISTENING
TCP    yourcomputer:1099      yourcomputer:0         LISTENING
TCP    yourcomputer:1521      yourcomputer:0         LISTENING
TCP    yourcomputer:2481      yourcomputer:0         LISTENING
TCP    yourcomputer:2482      yourcomputer:0         LISTENING
TCP    yourcomputer:2869      yourcomputer:0         LISTENING
TCP    yourcomputer:3260      yourcomputer:0         LISTENING
TCP    yourcomputer:3261      yourcomputer:0         LISTENING
TCP    yourcomputer:3306      yourcomputer:0         LISTENING
TCP    yourcomputer:3339      yourcomputer:0         LISTENING
TCP    yourcomputer:3389      yourcomputer:0         LISTENING
TCP    yourcomputer:8080      yourcomputer:0         LISTENING
TCP    yourcomputer:9090      yourcomputer:0         LISTENING
TCP    yourcomputer:1040      yourcomputer:0         LISTENING
TCP    yourcomputer:8007      yourcomputer:0         LISTENING
TCP    yourcomputer:netbios-ssn  yourcomputer:0         LISTENING
TCP    yourcomputer:1032      yourcomputer.domain:1748  ESTABLISHED
TCP    yourcomputer:1034      yourcomputer.domain:1521  ESTABLISHED
TCP    yourcomputer:1098      60.28.9.66:http        CLOSE_WAIT

端口也已经打开处于监听状态啦。怎么还是不行的呢?


这是我第一个RMI程序啊,希望各位大虾能帮帮忙找找原因,万分感谢!

论坛徽章:
0
发表于 2006-08-19 18:15 |显示全部楼层
从调试信息看,是没有找到CircleServerImpl_Stub这个类

论坛徽章:
0
发表于 2006-08-20 01:02 |显示全部楼层
可惜我是在当前目录中存在这个类的啊?而且我尝试运行其他类也正常啊?
到底怎么回事呢?

论坛徽章:
0
发表于 2006-08-20 13:44 |显示全部楼层
你需要在start rmiregistry 命令之前,把你的类加到环境的classpath之中。
主要原因是因为rmiregistry查找不到对应的stub的class
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP