public synchronized AppModule deploy(final AppModule appModule) throws OpenEJBException { final Set<String> abstractSchemaNames = new HashSet<String>(); for (final EjbModule ejbModule : appModule.getEjbModules()) { for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { if (isCmpEntity(bean)) { final EntityBean entity = (EntityBean) bean; final String name = entity.getAbstractSchemaName(); if (name != null) { abstractSchemaNames.add(name); } } } } final Map<String, String> contextData = new HashMap<String, String>(); contextData.put("appId", appModule.getModuleId()); for (final EjbModule ejbModule : appModule.getEjbModules()) { contextData.put("ejbJarId", ejbModule.getModuleId()); deploy(ejbModule, contextData, abstractSchemaNames); } contextData.clear(); return appModule; }