我编了一个入门的RMI程序,也成功调用rmic生成了两个框架类,安全文件也编写的没问题,但运行服务端时,老是报这样一个错:
HelloImpl.main: an exception occured:
java.rmi.ServerException: Server RemoteException; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: hello.HelloImpl_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at hello.HelloImpl.main(HelloImpl.java:27)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
ception is:
java.lang.ClassNotFoundException: hello.HelloImpl_Stub
Caused by: java.lang.ClassNotFoundException: hello.HelloImpl_Stub问题应该是找不到框架类hello.HelloImpl_Stub,但我已经成功调用过rmic了,而且也已经把它的相关位置设进了-classpath中了。我看以前的帖子说“rmiregistry必须要能够找到stub,skeleton”
我不明白如何才能让rmiregistry找到stub,skeleton,
有高人告诉我应该这样调用rmiregistry -Jjava.rmi.codebase=某个url
我分别这样试了试(我的桩类在g:/hello/hello里面):
rmiregistry -Jjava.rmi.codebase=g:/hello
rmiregistry -Jjava.rmi.codebase=g:/hello/
rmiregistry -Jjava.rmi.codebase=g:/hello/hello/
rmiregistry -Jjava.rmi.codebase=file://g:/hello
rmiregistry -Jjava.rmi.codebase=file://g:/hello/hello
rmiregistry -Jjava.rmi.codebase=file://g:/hello/
rmiregistry -Jjava.rmi.codebase=file://g:/hello/hello/
报告如下错误:
Error loading class java/rmi/codebase=g:/hello/hello: Bad major version number下面该怎么办啊,请高人指点指点,万分感激。(我在网上查了一下,有这个问题的很多,有的解决了,但都没有具体帖出是如何解决的)
HelloImpl.main: an exception occured:
java.rmi.ServerException: Server RemoteException; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: hello.HelloImpl_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at hello.HelloImpl.main(HelloImpl.java:27)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
ception is:
java.lang.ClassNotFoundException: hello.HelloImpl_Stub
Caused by: java.lang.ClassNotFoundException: hello.HelloImpl_Stub问题应该是找不到框架类hello.HelloImpl_Stub,但我已经成功调用过rmic了,而且也已经把它的相关位置设进了-classpath中了。我看以前的帖子说“rmiregistry必须要能够找到stub,skeleton”
我不明白如何才能让rmiregistry找到stub,skeleton,
有高人告诉我应该这样调用rmiregistry -Jjava.rmi.codebase=某个url
我分别这样试了试(我的桩类在g:/hello/hello里面):
rmiregistry -Jjava.rmi.codebase=g:/hello
rmiregistry -Jjava.rmi.codebase=g:/hello/
rmiregistry -Jjava.rmi.codebase=g:/hello/hello/
rmiregistry -Jjava.rmi.codebase=file://g:/hello
rmiregistry -Jjava.rmi.codebase=file://g:/hello/hello
rmiregistry -Jjava.rmi.codebase=file://g:/hello/
rmiregistry -Jjava.rmi.codebase=file://g:/hello/hello/
报告如下错误:
Error loading class java/rmi/codebase=g:/hello/hello: Bad major version number下面该怎么办啊,请高人指点指点,万分感激。(我在网上查了一下,有这个问题的很多,有的解决了,但都没有具体帖出是如何解决的)
解决方案 »
- 又一个奇怪的问题,
- 迭代器Iterator 取出set中的元素,有没有什么顺序的?
- 进度条问题
- 一个数据库更新问题~~~~在线求解~~~
- Image 如何转化为 InputStream
- 为什么我drawString的时候,总是在原来的地方继续draw,而没有擦去原来的string?
- 用rmi写网络文件传输有弊端吗??????????
- 有关tomcat在linux下配置的问题
- i need parse a html file into a dom tree, what tools should be used?
- 愿送100分,有谁能解释这幅图的关系及意思?
- 求助,在JAVA里面如何读取文件的最后N行的数据啊?(每一行的数据长度不定)急!!
- 如何把一个JPG图片尺寸缩小而不压缩图片的质量
把hello.HelloImpl_Stub和hello.HelloImpl_skeleton放到你的相应的class目录下就行了,
还有,你的java -version是什么?
classpath中试试