萍聚社区-德国热线-德国实用信息网

 找回密码
 注册

微信登录

微信扫一扫,快速登录

萍聚头条

查看: 652|回复: 0

1-1-4-4 HLP!ClassLoader!

[复制链接]
发表于 2003-2-6 16:54 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册 微信登录

x

  1. 发信人: rhythin (多米诺骨牌), 信区: Java      
  2. 标  题: HLP!ClassLoader!
  3. 发信站: BBS 水木清华站 (Mon Apr  5 14:57:31 1999)

  4. 同一个class用不同的ClassLoader调入, 系统会认为是相同的class吗?

  5. 发信人: Liyuany (缘分), 信区: Java
  6. 标  题: Re: HLP!ClassLoader!
  7. 发信站: BBS 水木清华站 (Mon Apr  5 17:01:13 1999) WWW-POST


  8.      我现在正在为这个问题头疼,系统绝对不会认为是同一个class.

  9. 【 在 rhythin (多米诺骨牌) 的大作中提到: 】
  10. : 同一个class用不同的ClassLoader调入, 系统会认为是相同的class吗?

  11. 发信人: rhythin (多米诺骨牌), 信区: Java      
  12. 标  题: Re: HLP!ClassLoader!
  13. 发信站: BBS 水木清华站 (Tue Apr  6 12:18:09 1999)

  14. 是啊, 我用一个小程序证明了这一点.
  15. 现在的问题是, 我要把一个用ClassLoader调入的对象export到RMI的Registry里去,
  16. 可是Client一lookup()就出了个ServerRuntimeException--ClassCastException.
  17. 这回可是彻底完了, 所有的工作都白做了.

  18. 【 在 Liyuany (缘分) 的大作中提到: 】
  19. :
  20. :      我现在正在为这个问题头疼,系统绝对不会认为是同一个class.
  21. :
  22. : 【 在 rhythin (多米诺骨牌) 的大作中提到: 】

  23. 发信人: Liyuany (缘分), 信区: Java
  24. 标  题: Re: HLP!ClassLoader!
  25. 发信站: BBS 水木清华站 (Wed Apr  7 12:48:06 1999) WWW-POST


  26.     看来真有缘分一说,hehe。我头疼的就是这个问题。我用自己的ClassLoader
  27. 装入jar文件。然后,利用rmi机制调用远程方法,就会有例外ClassNotFound。好象
  28. rmi用的装载器是系统的,它不认识我的ClassLoader装入的类。
  29.     不知道你做的是什么项目?能交流一下吗?如果愿意请给我发Email
  30. [email]lqw@csc.neu.edu.cn[/email]

  31. 【 在 rhythin (多米诺骨牌) 的大作中提到: 】
  32. : 是啊, 我用一个小程序证明了这一点.
  33. : 现在的问题是, 我要把一个用ClassLoader调入的对象export到RMI的Registry里去,
  34. : 可是Client一lookup()就出了个ServerRuntimeException--ClassCastException.
  35. : 这回可是彻底完了, 所有的工作都白做了.

  36. 发信人: rhythin (多米诺骨牌), 信区: Java      
  37. 标  题: Re: HLP!ClassLoader!
  38. 发信站: BBS 水木清华站 (Wed Apr  7 13:15:41 1999)

  39. 我给你发的信被退回来了, 说没这用户!
  40. Hi, I have partly solved the problem. If on the client side, we use
  41. Object instead of the remote interface to get the stub, no exception
  42. will be thrown.
  43. i.e.
  44. Object obj = Naming.lookup("//foo/bar");
  45. not RemoteBar obj = (RemoteBar) naming.lookup(...)

  46. That's why I asked the second question. Though you know the remote
  47. interface of the remote object, you cannot use it to cast the stub you
  48. got, because the class loaded by system will be treated as a different
  49. class. So maybe we have to use reflection to solve the problem, too bad.
  50. 【 在 Liyuany (缘分) 的大作中提到: 】
  51. :
  52. :     看来真有缘分一说,hehe。我头疼的就是这个问题。我用自己的ClassLoader
  53. : 装入jar文件。然后,利用rmi机制调用远程方法,就会有例外ClassNotFound。好象
  54. : rmi用的装载器是系统的,它不认识我的ClassLoader装入的类。
  55. :     不知道你做的是什么项目?能交流一下吗?如果愿意请给我发Email
  56. : [email]lqw@csc.neu.edu.cn[/email]
  57. :
  58. : 【 在 rhythin (多米诺骨牌) 的大作中提到: 】

  59. 发信人: rhythin (多米诺骨牌), 信区: Java      
  60. 标  题: Re: HLP!ClassLoader!
  61. 发信站: BBS 水木清华站 (Tue Apr 13 14:24:02 1999)

  62. What kinda system are you using? I just found that under solaris, the java
  63. jdk1.1.3 has some problem to deal with it, but if you use jdk1.1.6, it will be
  64. much better.

  65. 【 在 Liyuany (缘分) 的大作中提到: 】
  66. :
  67. :     看来真有缘分一说,hehe。我头疼的就是这个问题。我用自己的ClassLoader
  68. : 装入jar文件。然后,利用rmi机制调用远程方法,就会有例外ClassNotFound。好象
  69. : rmi用的装载器是系统的,它不认识我的ClassLoader装入的类。
  70. :     不知道你做的是什么项目?能交流一下吗?如果愿意请给我发Email
  71. : [email]lqw@csc.neu.edu.cn[/email]
  72. :
  73. : 【 在 rhythin (多米诺骨牌) 的大作中提到: 】


复制代码
Die von den Nutzern eingestellten Information und Meinungen sind nicht eigene Informationen und Meinungen der DOLC GmbH.
您需要登录后才可以回帖 登录 | 注册 微信登录

本版积分规则

手机版|Archiver|AGB|Impressum|Datenschutzerklärung|萍聚社区-德国热线-德国实用信息网 |网站地图

GMT+2, 2024-5-22 16:44 , Processed in 1.285855 second(s), 16 queries , MemCached On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表