URL persistenceUnitRootUrl = persistenceRoot.getHandler().toURL();
assert persistenceUnitRootUrl.getProtocol().equals("jar") || persistenceUnitRootUrl.getProtocol().equals("file") : "expected a jar or file url, but was " + persistenceUnitRootUrl;
URL persistenceXmlUrl = file.toURL();
PersistenceUnitsMetaData metaData = new PersistenceUnitsMetaData(persistenceUnitRootUrl, PersistenceXmlLoader.deploy(persistenceXmlUrl, new HashMap<String, String>(),
new EJB3DTDEntityResolver(), PersistenceUnitTransactionType.JTA));
log.info("Found persistence units " + metaData);
// FIXME: if in EAR then unscoped else scoped
return metaData;
}