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.
【 在 Liyuany (缘分) 的大作中提到: 】
∶
∶ 看来真有缘分一说,hehe。我头疼的就是这个问题。我用自己的ClassLoader
∶ 装入jar文件。然后,利用rmi机制调用远程方法,就会有例外ClassNotFound。好象
∶ rmi用的装载器是系统的,它不认识我的ClassLoader装入的类。
∶ 不知道你做的是什么项目?能交流一下吗?如果愿意请给我发Email
∶ lqw@csc.neu.edu.cn
∶
∶ 【 在 rhythin (多米诺骨牌) 的大作中提到: 】
--
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: cascade.cs.ubc.]
BBS水木清华站∶精华区