DefaultPersistenceUnitManager extracts jar file from default persistence unit root URL

Issue: SPR-14749
This commit is contained in:
Juergen Hoeller 2016-09-26 15:15:45 +02:00
parent 74c618892e
commit bb7d20762c
1 changed files with 2 additions and 2 deletions

View File

@ -615,8 +615,8 @@ public class DefaultPersistenceUnitManager
return null; return null;
} }
try { try {
Resource res = this.resourcePatternResolver.getResource(this.defaultPersistenceUnitRootLocation); URL url = this.resourcePatternResolver.getResource(this.defaultPersistenceUnitRootLocation).getURL();
return res.getURL(); return (ResourceUtils.isJarURL(url) ? ResourceUtils.extractJarFileURL(url) : url);
} }
catch (IOException ex) { catch (IOException ex) {
throw new PersistenceException("Unable to resolve persistence unit root URL", ex); throw new PersistenceException("Unable to resolve persistence unit root URL", ex);