2 Replies Latest reply on Nov 23, 2009 7:56 AM by Heiko Dähn

    getting ear-name

    Heiko Dähn Newbie

      Hello,

      how can I determine the name of the EAR-file in a Session Bean. (The Session Bean is a ejb-modul of this EAR.) Is it possible?

        • 1. Re: getting ear-name
          jaikiran pai Master

          Why do you want the ear file name? Is this related to the default jndi name to which the beans get bound? If yes, then you can override those. Which version of AS do you use?

          • 2. Re: getting ear-name
            Heiko Dähn Newbie

            I'm using JBoss AS 4.2.3.

            The problem is, I make some lookups of my Session Beans(the bean name is dynamically determined), but the EAR-name can change in different installations.
            I know the annotations @Remote-/@LocalBinding. That works fine, but now I must differ between same SessionBeans(equal source code) in different EARs.

            here is a sample, that comes my problem near:

            EAR1 contains MyHelloBean1, MyHelloBean2 and MyGreetingBean
            EAR2 contains MyHelloBean1, MyHelloBean2 and MyGreetingBean too

            MyGreetingBean determines the bean name from a database table.
            Now I have to lookup ("EAR-NAME/MyHelloBeanX/remote").