当前位置: 技术问答>java相关
RMI启动问题
来源: 互联网 发布时间:2015-07-12
本文导语: 查看了本论坛所有问题,还是没有解决如下的问题: 启动rmiregistry,stub,Skel也生成好了,打包成calc.jarjar文件, 生成策略文件java.policy, 运行java -cp "e:cacl.jar" -Djava.rmi.server.codebase=file:/e:cacl/ -Djava.security.policy=java.policy...
查看了本论坛所有问题,还是没有解决如下的问题:
启动rmiregistry,stub,Skel也生成好了,打包成calc.jarjar文件,
生成策略文件java.policy,
运行java -cp "e:cacl.jar" -Djava.rmi.server.codebase=file:/e:cacl/
-Djava.security.policy=java.policy CalcImpl
出现如下错误:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: examples.callback.MessageReceiverImpl_Stub
怎么解决????
启动rmiregistry,stub,Skel也生成好了,打包成calc.jarjar文件,
生成策略文件java.policy,
运行java -cp "e:cacl.jar" -Djava.rmi.server.codebase=file:/e:cacl/
-Djava.security.policy=java.policy CalcImpl
出现如下错误:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: examples.callback.MessageReceiverImpl_Stub
怎么解决????
|
codebase 属性没有设置好,客户不能找到cacl.CaclImpl_Stub,你需要一个简单的http server
请您仔细看看:
If you do start the rmiregistry and it can find your stub classes in CLASSPATH, it will not remember that the loaded stub class can be loaded from your server's code base, specified by the java.rmi.server.codebase property when you started up your server application. Therefore, the rmiregistry will not convey to clients the true code base associated with the stub class and, consequently, your clients will not be able to locate and to load the stub class or other server-side classes.
运行时命令大概象这样子:
java -Djava.rmi.server.codebase=file:/c:homeannpublic_htmlclasses/
-Djava.rmi.server.hostname=zaphod.east.sun.com
-Djava.security.policy=java.policy
engine.ComputeEngine
跟
java -Djava.rmi.server.codebase=file:/c:homejonespublic_htmlclasses/
-Djava.security.policy=java.policy
client.ComputePi zaphod.east.sun.com 20
更详细的:
http://java.sun.com/docs/books/tutorial/rmi/running.html
祝你好运
请您仔细看看:
If you do start the rmiregistry and it can find your stub classes in CLASSPATH, it will not remember that the loaded stub class can be loaded from your server's code base, specified by the java.rmi.server.codebase property when you started up your server application. Therefore, the rmiregistry will not convey to clients the true code base associated with the stub class and, consequently, your clients will not be able to locate and to load the stub class or other server-side classes.
运行时命令大概象这样子:
java -Djava.rmi.server.codebase=file:/c:homeannpublic_htmlclasses/
-Djava.rmi.server.hostname=zaphod.east.sun.com
-Djava.security.policy=java.policy
engine.ComputeEngine
跟
java -Djava.rmi.server.codebase=file:/c:homejonespublic_htmlclasses/
-Djava.security.policy=java.policy
client.ComputePi zaphod.east.sun.com 20
更详细的:
http://java.sun.com/docs/books/tutorial/rmi/running.html
祝你好运
|
先试试不打包的.
错误是类没找到,看看你指定的codebase下是否有这个类
examples.callback.MessageReceiverImpl_Stub,存放的路径对不对?
错误是类没找到,看看你指定的codebase下是否有这个类
examples.callback.MessageReceiverImpl_Stub,存放的路径对不对?
|
你启动rmiregistry是不是在e:cacl目录下,如果不是,应该找不到cacl.CaclImpl_Stub。