1 Reply Latest reply on Oct 11, 2007 12:17 PM by wayne baylor

    How do I make a lookup in an ear.

    Heiko Dähn Newbie

      Here are my deployed components on the same server:

      -myapp1.ear
      - abcbean.jar
      - xyzbean.jar
      - ...

      -myapp2.ear
      - abcbean.jar
      - xyzbean.jar
      - ...

      When I make the lookup
      'jndiContext.lookup("myapp1/abcbean/local")' and 'jndiContext.lookup("myapp2/abcbean/local")' everything works fine.

      Inside of the abcbean.jar there are one EJB3 and some other nonejb-classes from an older framework that I use to make my business logic.
      The EJB3 I use to delegate the request from client to my BusinessLogic.
      Now I have to look up the xyzbean.jar from an nonejb, but I could not know, that my ear-name(i.e. context name) is myapp1 or myapp1.

      How can I do that in a generic kind?

      thx

        • 1. Re: How do I make a lookup in an ear.
          wayne baylor Apprentice

          the "myapp1/abcbean/local" and "myapp2/abcbean/local" are default jndi names. what you should do is override them with your own jndi names. that way you can name your ear whatever you want and still use the same jndi lookups.

          to override the default jndi names you can use the jboss annotations @LocalBinding & @RemoteBinding, or you can do it in the ejb-jar.xml & jboss.xml descriptors.