This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I understand that you have an application that is deployed at two ears, but I don�t understand why would you do that. If that�s the case, you might notice one thing: from the container perspective they are two different applications. Your container will use different classloaders for loading classes in both ears and you have no way to overcome this. If for example you have a bean A in first ear that needs to call a method on a bean B in the second ear, you have to do the usual jndi lookup, and use B�s remote interface in order to invoke business methods. This also implies that the first ear needs to include B�s home and remote interfaces, just like any other client application. Even worse, because they are distinct applications you won�t be able to use local interfaces. So I guess that you might reconsider your approach. Regards.