Refine DefaultPersistenceUnitManager#determineDefaultPersistenceUnitRootUrl
This commit refines the implementation to be more lenient when defaultPersistenceUnitRootLocation is equals to ORIGINAL_DEFAULT_PERSISTENCE_UNIT_ROOT_LOCATION and an IOException is thrown, which happens when running on native image. Closes gh-29137
This commit is contained in:
parent
6cfbf391ec
commit
6fed342543
|
@ -579,6 +579,10 @@ public class DefaultPersistenceUnitManager
|
|||
return (ResourceUtils.isJarURL(url) ? ResourceUtils.extractJarFileURL(url) : url);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
if (ORIGINAL_DEFAULT_PERSISTENCE_UNIT_ROOT_LOCATION.equals(this.defaultPersistenceUnitRootLocation)) {
|
||||
logger.debug("Unable to resolve classpath root as persistence unit root URL");
|
||||
return null;
|
||||
}
|
||||
throw new PersistenceException("Unable to resolve persistence unit root URL", ex);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue