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?
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").