users@glassfish.java.net

Re: Conjoint using of EJB3 and EJB2

From: <glassfish_at_javadesktop.org>
Date: Mon, 05 Jan 2009 10:09:32 PST

Hi Martin,

When using the EJB 2.x client view, the object returned from the lookup
is a reference to the Home interface, not the component interface.
The portable way to code this is :

Object o = ctx.lookup(...);
SimpleBeanHome home = (SimpleBeanHome)
  PortableRemoteObject.narrow(o, SimpleBeanHome.class);
SimpleBean bean = home.create();
...

A direct cast to SimpleBeanHome will work in our implementation but it's
not guaranteed to be portable.
[Message sent by forum member 'ksak' (ksak)]

http://forums.java.net/jive/thread.jspa?messageID=324106