Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
4.5.1, 4.5.2
-
None
-
None
-
windows, MacOSX
Description
I have a ear file which can run the other app server but failed in TOMEE when it has persistence.xml in ear file's META-INF folder. I look at the source code and find the issue.I am sure if it has been fixed in 1.5.2. But I'd like to share my fix.
in DeploymentLoader.java in openejb-4.5.0\container\openejb-core\src\main\java\org\apache\openejb\config
in method: AppModule createAppModule(final File jarFile, final String jarPath)
after the following line:
appModule.getAltDDs().putAll(appDescriptors);
we should convert persistence.xml entry to List<URL>. I add a very simple method in the following lines
private static void convertPersistenceToList(Map map){
Object url = map.get("persistence.xml");
if(url!=null && url instanceof URL)
}
and call it like the following lines
Map<String, Object> altDDs = appModule.getAltDDs();
altDDs.putAll(appDescriptors);
convertPersistenceToList(altDDs);