0 Replies Latest reply on Nov 1, 2010 10:30 AM by Roger Lee


    Roger Lee Apprentice

      I am confused as to whether it is best practice to use Component.getInstance(MyRemote.class) or just use JNDI lookup.

      I have a Seam RESTful bean which needs to access one of my SF Session Beans.

      public class RESTfulBean implements NOTiFYPiNPOiNTConstants, Serializable {

      I can access the SFSB fine using;

      final Context ic = getInitialContext();
      o = ic.lookup("ejb/PostcardRemote");
      postcardRemote = (PostcardRemote) PortableRemoteObject.narrow(o, PostcardRemote.class);

      The calling the method;

      public String getRESTfulByDomain(@PathParam("domain") String domain) {
          log.info(">>>>> getRESTfulByDomain domain = " + domain);
          return "is this working?";

      What is the correct/best way/method to access a SF or SL Session Bean from within a SEAM RESTful bean?