1

I have a vexing problem. I'm upgrading stuff to j11 and the latest of everything but I can't change too much of the app itself. The created jar file contains within itself a jar file that contains mapped entities, like this:

jar

  • BOOT-INF
    • classes
      • application classes
    • lib
      • entity lib
  • META-INF
    • persistence.xml

In my persistence.xml I refer to the entity lib through the <jar-file> directive like so:

            <jar-file>BOOT-INF/lib/EntityLib-1.0.jar</jar-file>

But the scanner can't find it. (I get java.nio.file.NoSuchFileException: BOOT-INF/lib/EntityLib-1.0.jar)

I've read parts of JSR-338, JPA 2.1 and looked at the examples but I haven't gotten any further. I'm using Hibernate 5.3.3.Final This is a spring boot application but the original developers used basic JPA instead of the spring func and I'm not allowed to rewrite the app that much (nor do I want to, to be honest).

EDIT: the app is created through the normal spring-boot-maven-plugin.

Erik
  • 2,013
  • 11
  • 17
  • Was this JAR generated using the standard procedure (i.e. the default Spring Boot Maven/Gradle plugin config)? I would have expected `persistence.xml` to end up under `BOOT-INF/classes/META-INF`. `lib/EntityLib-1.0.jar` would then be correct – crizzis Aug 11 '20 at 16:26
  • @crizzis Yes, it uses the spring-boot-maven-plugin – Erik Aug 11 '20 at 16:36
  • @crizzis actually, the BOOT-INF/classes/META-INF lib does not exist – Erik Aug 12 '20 at 07:22
  • My previous comment might have been unnecessarily confusing. What I meant was I thought `persistence.xml` would normally end up under `BOOT-INF/classes/META-INF` and **not** the root `META-INF`. The persistence provider should then accept a simple `lib/xxx.jar` path. I might be mistaken, though – crizzis Aug 12 '20 at 22:25
  • @crizzis When running from the command line , BOOT-INF/lib/EntityLib-1.0.jar but in Intellij it fails. – Erik Aug 13 '20 at 14:44

0 Answers0