This content has been marked as final. Show 1 reply
but can anyone suggest a way to restrict the lookups to the ear file without having to rename every bean???
How about adding a jboss.xml file to each of the application and specifying a different jndi name for the beans in each application? Something like:
in jboss.xml of app1:
in jboss.xml of app2:
Ofcourse, you would have to change the code where the lookup of the bean is happening.
String appName = getAppName();//implement some logic to pickup the appName from a properties file or the env-entry Context ctx = new InitialContext(); DataManager) manager = (DataManager)ctx.lookup(appName + "/ejb/DataManagerBean");