-4
如何使用遠程主機上的正確參數運行rmiregistry和RMI服務器?如何使用正確的參數運行rmiregistry和rmi服務器?
運行RMI客戶端時,得到了這樣的問題:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.net.MalformedURLException: unknown protocol: c
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.labros.client.TestClient.main(TestClient.java:33)
Caused by: java.net.MalformedURLException: unknown protocol: c
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
我開始rmiregistry中與遠程主機上的以下內容:
rmiregistry -J-Djava.rmi.server.codebase=file:///export/home/timsadm/Projects/rmi-server/classes -J-Djava.security.policy=/export/home/timsadm/Projects/rmi-server/classes/java.policy &
與
java -Djava.rmi.server.codebase=file:///export/home/timsadm/Projects/rmi-server/classes -Djava.security.policy=/export/home/timsadm/Projects/rmi-server/classes/java.policy com.labros.server.Server
Server started
在遠程主機上啓動rmiregistry,具體如下: john @ john:〜/ Projects/rmi-server/classes $ rmiregistry -J -Djava.rmi.server.codebase = file:/// export/home/timsadm/Projects/rmi-server/classes -J-Djava.security.policy =/export/home/timsadm/Projects/rmi-server/classes/java.policy& 和服務器: john @ john :〜/ Projects/rmi-server/classes $ java -Djava.rmi.server.codebase = file:/// export/home/timsadm/Projects/rmi-server/classes -Djava.security.policy =/export/home /timsadm/Projects/rmi-server/classes/java.policy com.labros.server.Server 服務器啓動... – Labros
你應該[編輯]到你的問題,而不是發表評論。 – Mogsdad
請勿對未引用的文本使用引號格式,並且對代碼或計算機輸出的文本使用代碼格式。 – EJP