Skip to content

Package JPA with orm.xml fails with odd error: "cannot be resolved to URL because it does not exist" in Spring-Boot 1.4.0.M2 #5842

Closed
@pavax

Description

@pavax

Since we updated from spring-boot 1.3.3 to 1.4.M2 we receive a odd exception if we start our application by packing it into a execuatable jar (or war). This problem only occurs if you don't scan for any entities in your classpath but rather define the mapping in a orm.xml. The Bug seems to be similar to an already fixed one: #420

Everything works if we start the Application with the Application.java main method or if we deploy the (execuatable) war file to tomcat. The problem does not occur if there has been at least one Entity defined/scanned by using the javax.persistence annotations

Tested Versions
Spring Boot Version 1.4.0.M2
Spring Boot Version 1.3.3 (works)

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:187)
        at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:588)
        ... 31 common frames omitted

Example Project:
https://github.com/pavax/sample-spring-boot-app

Howto

  1. mvn clean install
  2. start the application java -jar sample-spring-boot-app.jar

alternatively: change the packaging of the sample-spring-boot-web to war and active the profile executable-war.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: blockerAn issue that is blocking us from releasingtype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions