奇怪呀,是我问题没描述清楚吗?一般获得一个ejb不都是先lookup获得home的引用,再用它的引用narrow一下才能真正得到home实例的引用吗,问的就是这个问题,什么时候远程的东西需要narrow,什么时候不需要。
解决方案 »
- 亲们,我是web初学者,在运行中报了这样一个错,跪求解
- 如何写接口文件
- 请指教,如何阅读jo!、tomcat源代码?
- 请问ResultSet 在数据表为空情况下 返回什么值
- 很奇怪的一个问题?
- 请各位大哥大姐指导下!关于一个考试系统
- 成都的J2EE程序员工资怎么要的比北京贵好多啊
- extjs 求助
- spring配合Mybatis 调用有返回结果集的存储过程,总是报java.lang.nullpointerexception 错误
- 这样的配置能跑JB8+WL7+ORACLE9吗?
- 怎样在Weblogic8.1中自动创建Domain并部署应用?
- HibernateUtil包怎么找不到呢,急啊。。。
PortableRemoteObject.narrow方法起到一个检查类型的目的
欢迎高手加入!!!!!!!!!!!!!QQ群:
唯爱J2EE(java开发):14402276(人员已满)
唯爱J2EE(二群):15472518
********************不要重复加入,谢谢**************************
此群只加J2EE方面的人才与高手...或搞JAVA 一年以上的.....其他人不加........加群时,,注明:J2EE方面的技术体系,,,如:Struts,Spring,Hibenate,EJB,JSF,Ajax,Oracle,Weblogic等有关技术,方能通过....
是啊,我知道远程需要lookup,但为什么呢?看了jdk的源代码,但太长太多,看不明白。
the remote object, we perform the operation javax.rmi.PortableRemote
Object.narrow(). This is a static method on an RMI-IIOP class called
PortableRemoteObject. This method casts the generic object that we
looked up via JNDI to our RMI-IIOP interface type. This narrow() operation
is required whenever you look up an RMI-IIOP object via JNDI. Why do we
need it, and why don’t we just cast it using a regular Java cast? The short
answer is that the networking layer needs a chance to sneak in and create the
necessary stub objects. Obviously, the code for these stubs must be available at
this time. In most cases, that requires that the rmic command has been run previously
to generate them.
群号: 23943948
名字: 程序↑人生?⑴
要求: J2EE高手进 热心人进 你的指点将使你我他茅舍顿开
远程调用要narrow!
本地调用lookup!
不过要是用narrow是不是不能本地调用啊