GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes using ejb reference dynamicly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "using ejb reference dynamicly" Watch "using ejb reference dynamicly" New topic
Author

using ejb reference dynamicly

marc de toutophone
Greenhorn

Joined: Jul 16, 2003
Posts: 4
hello
I use ejb in order to modelise other ejb.
so i create an instance of an ejb in an other
ejb wich is not in the same application.
when the method narow is thrown i catch a
Cast exception.
if i put manually a reference i have no exception
but i lost the dynamicity?
did you have the same problem?
what is the solution?
(excuse me for my bad english)
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

if i put manually a reference i have no exception
but i lost the dynamicity?

I havent understood. Can you please explain?


Groovy
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Originally posted by marc de toutophone:
when the method narow is thrown i catch a
Cast exception.
if i put manually a reference i have no exception
but i lost the dynamicity?

I think what you're saying is that you need to use the EJB's interface in order to narrow the remote stub, but then you are hard-coding the EJB. Is this correct?
If so, you could pass in the EJB's interface's class as a parameter or make it a configuration item for use with Class.forName().
marc de toutophone
Greenhorn

Joined: Jul 16, 2003
Posts: 4
yes i uses forName() to modelise the class of the remote interface
but the ejb is deployed on an other application server and so
i use an other context where i do the lookup.
the lookup return the well class , forname also
but narrow can't cast the 2 class.
if i deploy on the same application server and so i have
the same context, narrow dont send an exception
 
GeeCON Prague 2014
 
subject: using ejb reference dynamicly