I have two EARs. These EARs use the same persistence unit (the persistence unit included in each ear). I would like to deploy this persistence unit as a standalone unit and share it among these EARs. It is deployed successfully but EARs throw ClassCastException when they are loading instance(s). I suspect that problem is in a different classloaders. So, my question is: Is it possible to deploy persistence unit in a standalone mode when it is shared between several EARs?