0 Replies Latest reply on Dec 7, 2005 12:59 PM by dreu zel

    EJB3 the contect  the  lookup

    dreu zel Novice

      Hi,

      I'm just starting with EJB, and there's one thing I don't
      see very clear, I'm very confused anyhow

      I tried writing a simple echoing EJB
      path: tst.echo with a Remote and Local interface
      i'm using JBOSS as EJB server and want to find my EJB from a servlet
      AND FROM a standalone program I want to access echoLOCAL.
      I'm using annotation and call my bean
      @Stateful(name="hasbean") no path nor anything
      my intialcontext seems to succeed.
      JBOSS signals my bean is intalled


      how the hell can I find back the bean ???? in JBOSS Standalone

      ctx.lookup("hasbean") ?
      ctx.lookup("hasbean") ?
      ctx.lookup("java:hasbean") ?
      ctx.lookup("java:/env/hasbean") ?
      ctx.lookup("java:/env/ejb/hasbean") ?
      ctx.lookup("java:/env/ejb3/hasbean") ?
      or that other combination
      agree there is a need for a standard ? but htere is also a need for
      some proper explanation ??
      after trying most combinations I'm completely lost

      I tried looking in the list be
      EnumerationNaming ns ctx.list("hasbean")
      EnumerationNaming ns ctx.list(java:hasbean")
      EnumerationNaming ns ctx.list(java:)
      EnumerationNaming ns ctx.list(java:/env)
      EnumerationNaming ns ctx.list(java:/env/)
      EnumerationNaming ns ctx.list(java:/env/ejb)
      EnumerationNaming ns ctx.list(java:/env/ejb/)
      EnumerationNaming ns ctx.list(java:/env/ejb3/)
      EnumerationNaming ns ctx.list(java:/env/ejb3)


      but all without any success

      Where to use the EJB name and where to use the JNDI name.
      Looks like the EJB name is used in the bean, and the JNDI name
      is used in JBoss, but how about in the client ?

      Moreover the "path" often varies:
      sometimes the "full path" (java:comp/env/ejb/thebean) is used
      sometimes ejb/thebean
      sometimes thebean

      Thanks for any enlightment...