Skip to content

JPA without persistence.xml fails when all classpath items are jars [SPR-8832] #13474

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: commits 62e5b9d

9 votes, 11 watchers

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions