Java 版 (精华区)
发信人: bali (阿奔), 信区: Java
标 题: Re: HLP!ClassLoader!
发信站: 紫 丁 香 (Mon Mar 27 08:35:35 2000), 转信
BBS水木清华站∶精华区
发信人: rhythin (多米诺骨牌), 信区: Java
标 题: Re: HLP!ClassLoader!
发信站: BBS 水木清华站 (Wed Apr 7 13:15:41 1999)
我给你发的信被退回来了, 说没这用户!
Hi, I have partly solved the problem. If on the client side, we use
Object instead of the remote interface to get the stub, no exception
will be thrown.
i.e.
Object obj = Naming.lookup("//foo/bar");
not RemoteBar obj = (RemoteBar) naming.lookup(...)
That's why I asked the second question. Though you know the remote
interface of the remote object, you cannot use it to cast the stub you
got, because the class loaded by system will be treated as a different
class. So maybe we have to use reflection to solve the problem, too bad.
--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: 202.118.243.89]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:9.040毫秒