URL propsUrl = this.getClass().getClassLoader().getResource("META-INF/persistence.properties");
properties = new Properties();
properties.load(propsUrl.openStream());
/* Current hack to establish the hibernate bytecode provider from the
externalized persistence.properties
*/
String bcprovider = properties.getProperty("hibernate.bytecode.provider", "javassist");
System.setProperty("hibernate.bytecode.provider", bcprovider);