Closed
Description
Artem Troitskiy opened SPR-8832 and commented
LocalContainerEntityManagerFactoryBean
with setPackagesToScan()
and without persistence.xml
fails when all classpath items are jars with the following exception:
Caused by: java.io.FileNotFoundException: class path resource [] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:179)
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:426)
It doesn't fail if at least one classpath item is a folder.
It's caused by attempt to resolve a pattern pointing to the classpath root ("classpath:"
) that doesn't work for jars.
Affects: 3.1 RC1
Issue Links:
- Unable to resolve persistence unit root URL with LocalContainerEntityManagerFactoryBean [SPR-15304] #19869 Unable to resolve persistence unit root URL with LocalContainerEntityManagerFactoryBean
- DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl fails when run from a shaded jar [SPR-14246] #18819 DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl fails when run from a shaded jar
Referenced from: commits 62e5b9d
9 votes, 11 watchers