When and why should PortableRemoteObject.narrow() be used vs. a standard
cast? I've noticed that in the Monson-Haefal book, he uses standard casts
after doing JNDI lookups. That's the way we've been doing things here, and
it seems to work fine (though we haven't actually deployed any ejbs to
production servers, yet). Most other code snippets I've seen seem to use
.narrow(), but I haven't been able to find any explanation for why... all
the javadocs say for .narrow() is "Checks to ensure that an object of a
remote or abstract interface type can be cast to a desired type.", but we
seem to get the same effect by just trying to cast normally. Is there some
advantage to using .narrow() that I'm not aware of?
Steve Holder
-----Original Message-----
From: Christensen, Kurt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 15, 2000 12:11 PM
To: [EMAIL PROTECTED]
Subject: Re: JSP-EJB problem.
Probably you need to NOT do an RMI-style (that is, ordinary Java) type cast
and use a CORBA type cast, which will look something like:
MyDesiredType castedObject =
(MyDesiredType)javax.rmi.PortableRemoteObject.narrow( passedObject,
<java.lang.Class object that corresponds to MyDesiredType>)
KurtC
-----Original Message-----
From: Amit Tyagi [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 15, 2000 7:01 PM
To: [EMAIL PROTECTED]
Subject: JSP-EJB problem.
Hi all,
We r using JSP-EJB platform. Application Server we r
using is Silver Stream 3.0. We have deployed JSP and
EJB to App. Server. But we r unable to make JavaBean
(used in JSP) talk to EJB.
We get correct initialContext and lookup is also
successfull. But when we try to type cast object
returned in the lookup to our home interface. it
generates class cast exception. What could be the
reason? Object returned is the stub of home interface.
Does Silverstream 3 supports Javabeans looking up for
EJB?
Thankx in advance
Bye
Amit Tyagi
reply to [EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".