Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using ejb reference dynamicly

 
marc de toutophone
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i put manually a reference i have no exception
but i lost the dynamicity?

I havent understood. Can you please explain?
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic