2 Replies Latest reply on Oct 23, 2006 1:16 PM by William Conroy

    Local Lookup

    William Conroy Newbie

      I have a Job I am executing via quartz that needs to look up a local interface. I cannot use injection since my job is not a bean. I assume I need to do an initial context lookup, but I apparently have to know the ear name the bean is deployed in. Is there a way I can do a lookup without needing to know the ear name? or is there a way from my class I can get the ear it came out of at runtime?

        • 1. Re: Local Lookup
          Andrew Rubinger Master

          By default, the EJB is bound to a JNDI address prefixed by the EAR name...I like to override this, specifying my own address by using @LocalBinding and @RemoteBinding annotations in order to ensure the bean always ends up in the same place, no matter the packaging.


          • 2. Re: Local Lookup
            William Conroy Newbie

            I would like to keep the jndi names bound with the ear name that way i can deploy multiple applications with the same beans (or at least bean names) together on the same jboss instance. The question is more of internal to the application, if I need to look up a bean, but cannot use injections (in my case because it is a scheduled job not a bean), how can I find the ear name/application a class is deployed in at runtime? Is that even possible