Unable to resolve persistence unit root URL in Java 9 multi module environment












1















I'm trying to make a Spring Boot Maven multi-module app in Java 9. It works without adding Spring Data support and @Entity classes, but now it won't start.
The problem is the following exception:



org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) ~[spring-beans-5.0.9.RELEASE.jar:na]
at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573) ~[spring-beans-5.0.9.RELEASE.jar:na]
at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar:na]
at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar:na]
at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar:na]
at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar:na]
at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar:na]
at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1089) ~[spring-context-5.0.9.RELEASE.jar:na]
at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:859) ~[spring-context-5.0.9.RELEASE.jar:na]
at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.9.RELEASE.jar:na]
at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) [spring-boot-2.0.5.RELEASE.jar:na]
at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.0.5.RELEASE.jar:na]
at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:333) [spring-boot-2.0.5.RELEASE.jar:na]
at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) [spring-boot-2.0.5.RELEASE.jar:na]
at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) [spring-boot-2.0.5.RELEASE.jar:na]
at hu.kleatech.jigsaw/hu.kleatech.jigsaw.MainApplication.main(MainApplication.java:18) [classes/:na]
Caused by: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:637) ~[spring-orm-5.0.9.RELEASE.jar:na]
at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:459) ~[spring-orm-5.0.9.RELEASE.jar:na]
at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.afterPropertiesSet(DefaultPersistenceUnitManager.java:440) ~[spring-orm-5.0.9.RELEASE.jar:na]
at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:328) ~[spring-orm-5.0.9.RELEASE.jar:na]
at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1758) ~[spring-beans-5.0.9.RELEASE.jar:na]
at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1695) ~[spring-beans-5.0.9.RELEASE.jar:na]
... 15 common frames omitted
Caused by: java.io.FileNotFoundException: class path resource cannot be resolved to URL because it does not exist
at spring.core@5.0.9.RELEASE/org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195) ~[spring-core-5.0.9.RELEASE.jar:na]
at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:633) ~[spring-orm-5.0.9.RELEASE.jar:na]
... 20 common frames omitted


There are a few examples of this exception on the internet, but none of them is relevant for me. I believe that the multi-module Java 9 environment causes the problem somehow, so this question is not a duplicate of the others.



I tried every possible solutions I could find and think of, I even tried to manually configure everything, none of them helped or got me closer to the cause. But there's one thing I found interesting in those solutions: it seems that this exception is thrown when Spring Boot cannot find any @Entity class. So I'm thinking the @Entity classes are somehow not visible through the module system.



Since the problem seems to be dependent of the environment, here's the whole project: (Note that it's in very early state, most of it is incomplete, but should at least run)
https://github.com/KleaTech/szakdolgozat



Any help is appreciated, I'm out of ideas.










share|improve this question



























    1















    I'm trying to make a Spring Boot Maven multi-module app in Java 9. It works without adding Spring Data support and @Entity classes, but now it won't start.
    The problem is the following exception:



    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
    at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) ~[spring-beans-5.0.9.RELEASE.jar:na]
    at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573) ~[spring-beans-5.0.9.RELEASE.jar:na]
    at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar:na]
    at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar:na]
    at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar:na]
    at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar:na]
    at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar:na]
    at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1089) ~[spring-context-5.0.9.RELEASE.jar:na]
    at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:859) ~[spring-context-5.0.9.RELEASE.jar:na]
    at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.9.RELEASE.jar:na]
    at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) [spring-boot-2.0.5.RELEASE.jar:na]
    at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.0.5.RELEASE.jar:na]
    at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:333) [spring-boot-2.0.5.RELEASE.jar:na]
    at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) [spring-boot-2.0.5.RELEASE.jar:na]
    at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) [spring-boot-2.0.5.RELEASE.jar:na]
    at hu.kleatech.jigsaw/hu.kleatech.jigsaw.MainApplication.main(MainApplication.java:18) [classes/:na]
    Caused by: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
    at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:637) ~[spring-orm-5.0.9.RELEASE.jar:na]
    at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:459) ~[spring-orm-5.0.9.RELEASE.jar:na]
    at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.afterPropertiesSet(DefaultPersistenceUnitManager.java:440) ~[spring-orm-5.0.9.RELEASE.jar:na]
    at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:328) ~[spring-orm-5.0.9.RELEASE.jar:na]
    at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1758) ~[spring-beans-5.0.9.RELEASE.jar:na]
    at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1695) ~[spring-beans-5.0.9.RELEASE.jar:na]
    ... 15 common frames omitted
    Caused by: java.io.FileNotFoundException: class path resource cannot be resolved to URL because it does not exist
    at spring.core@5.0.9.RELEASE/org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195) ~[spring-core-5.0.9.RELEASE.jar:na]
    at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:633) ~[spring-orm-5.0.9.RELEASE.jar:na]
    ... 20 common frames omitted


    There are a few examples of this exception on the internet, but none of them is relevant for me. I believe that the multi-module Java 9 environment causes the problem somehow, so this question is not a duplicate of the others.



    I tried every possible solutions I could find and think of, I even tried to manually configure everything, none of them helped or got me closer to the cause. But there's one thing I found interesting in those solutions: it seems that this exception is thrown when Spring Boot cannot find any @Entity class. So I'm thinking the @Entity classes are somehow not visible through the module system.



    Since the problem seems to be dependent of the environment, here's the whole project: (Note that it's in very early state, most of it is incomplete, but should at least run)
    https://github.com/KleaTech/szakdolgozat



    Any help is appreciated, I'm out of ideas.










    share|improve this question

























      1












      1








      1


      0






      I'm trying to make a Spring Boot Maven multi-module app in Java 9. It works without adding Spring Data support and @Entity classes, but now it won't start.
      The problem is the following exception:



      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1089) ~[spring-context-5.0.9.RELEASE.jar:na]
      at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:859) ~[spring-context-5.0.9.RELEASE.jar:na]
      at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.9.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) [spring-boot-2.0.5.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.0.5.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:333) [spring-boot-2.0.5.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) [spring-boot-2.0.5.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) [spring-boot-2.0.5.RELEASE.jar:na]
      at hu.kleatech.jigsaw/hu.kleatech.jigsaw.MainApplication.main(MainApplication.java:18) [classes/:na]
      Caused by: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:637) ~[spring-orm-5.0.9.RELEASE.jar:na]
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:459) ~[spring-orm-5.0.9.RELEASE.jar:na]
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.afterPropertiesSet(DefaultPersistenceUnitManager.java:440) ~[spring-orm-5.0.9.RELEASE.jar:na]
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:328) ~[spring-orm-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1758) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1695) ~[spring-beans-5.0.9.RELEASE.jar:na]
      ... 15 common frames omitted
      Caused by: java.io.FileNotFoundException: class path resource cannot be resolved to URL because it does not exist
      at spring.core@5.0.9.RELEASE/org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195) ~[spring-core-5.0.9.RELEASE.jar:na]
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:633) ~[spring-orm-5.0.9.RELEASE.jar:na]
      ... 20 common frames omitted


      There are a few examples of this exception on the internet, but none of them is relevant for me. I believe that the multi-module Java 9 environment causes the problem somehow, so this question is not a duplicate of the others.



      I tried every possible solutions I could find and think of, I even tried to manually configure everything, none of them helped or got me closer to the cause. But there's one thing I found interesting in those solutions: it seems that this exception is thrown when Spring Boot cannot find any @Entity class. So I'm thinking the @Entity classes are somehow not visible through the module system.



      Since the problem seems to be dependent of the environment, here's the whole project: (Note that it's in very early state, most of it is incomplete, but should at least run)
      https://github.com/KleaTech/szakdolgozat



      Any help is appreciated, I'm out of ideas.










      share|improve this question














      I'm trying to make a Spring Boot Maven multi-module app in Java 9. It works without adding Spring Data support and @Entity classes, but now it won't start.
      The problem is the following exception:



      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1089) ~[spring-context-5.0.9.RELEASE.jar:na]
      at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:859) ~[spring-context-5.0.9.RELEASE.jar:na]
      at spring.context@5.0.9.RELEASE/org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.9.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.refresh(SpringApplication.java:780) [spring-boot-2.0.5.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.0.5.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:333) [spring-boot-2.0.5.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:1277) [spring-boot-2.0.5.RELEASE.jar:na]
      at spring.boot@2.0.5.RELEASE/org.springframework.boot.SpringApplication.run(SpringApplication.java:1265) [spring-boot-2.0.5.RELEASE.jar:na]
      at hu.kleatech.jigsaw/hu.kleatech.jigsaw.MainApplication.main(MainApplication.java:18) [classes/:na]
      Caused by: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:637) ~[spring-orm-5.0.9.RELEASE.jar:na]
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:459) ~[spring-orm-5.0.9.RELEASE.jar:na]
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.afterPropertiesSet(DefaultPersistenceUnitManager.java:440) ~[spring-orm-5.0.9.RELEASE.jar:na]
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:328) ~[spring-orm-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1758) ~[spring-beans-5.0.9.RELEASE.jar:na]
      at spring.beans@5.0.9.RELEASE/org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1695) ~[spring-beans-5.0.9.RELEASE.jar:na]
      ... 15 common frames omitted
      Caused by: java.io.FileNotFoundException: class path resource cannot be resolved to URL because it does not exist
      at spring.core@5.0.9.RELEASE/org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195) ~[spring-core-5.0.9.RELEASE.jar:na]
      at spring.orm@5.0.9.RELEASE/org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:633) ~[spring-orm-5.0.9.RELEASE.jar:na]
      ... 20 common frames omitted


      There are a few examples of this exception on the internet, but none of them is relevant for me. I believe that the multi-module Java 9 environment causes the problem somehow, so this question is not a duplicate of the others.



      I tried every possible solutions I could find and think of, I even tried to manually configure everything, none of them helped or got me closer to the cause. But there's one thing I found interesting in those solutions: it seems that this exception is thrown when Spring Boot cannot find any @Entity class. So I'm thinking the @Entity classes are somehow not visible through the module system.



      Since the problem seems to be dependent of the environment, here's the whole project: (Note that it's in very early state, most of it is incomplete, but should at least run)
      https://github.com/KleaTech/szakdolgozat



      Any help is appreciated, I'm out of ideas.







      spring hibernate spring-data-jpa java-9 jigsaw






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 19 '18 at 19:36









      Ádám BozzayÁdám Bozzay

      438




      438
























          1 Answer
          1






          active

          oldest

          votes


















          1














          You need to add these dependencies to pom.xml (or provide them in a different way, if you do not use maven):



          <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <version>2.3.0</version>
          </dependency>
          <dependency>
          <groupId>net.bytebuddy</groupId>
          <artifactId>byte-buddy</artifactId>
          <version>1.9.3</version>
          </dependency>


          and include them in module-info.java



          open module org.demo {
          ...
          requires java.xml.bind;
          requires net.bytebuddy;
          }





          share|improve this answer
























          • Thank you for your answer. Since I didn't get an answer for a long time, I went to a different route. I bypassed the problem, because I couldn't solve it. Maybe eventually I'll go back to the orginal (more suitable) solution, and try your suggestion.

            – Ádám Bozzay
            Nov 15 '18 at 14:56











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52413088%2funable-to-resolve-persistence-unit-root-url-in-java-9-multi-module-environment%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You need to add these dependencies to pom.xml (or provide them in a different way, if you do not use maven):



          <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <version>2.3.0</version>
          </dependency>
          <dependency>
          <groupId>net.bytebuddy</groupId>
          <artifactId>byte-buddy</artifactId>
          <version>1.9.3</version>
          </dependency>


          and include them in module-info.java



          open module org.demo {
          ...
          requires java.xml.bind;
          requires net.bytebuddy;
          }





          share|improve this answer
























          • Thank you for your answer. Since I didn't get an answer for a long time, I went to a different route. I bypassed the problem, because I couldn't solve it. Maybe eventually I'll go back to the orginal (more suitable) solution, and try your suggestion.

            – Ádám Bozzay
            Nov 15 '18 at 14:56
















          1














          You need to add these dependencies to pom.xml (or provide them in a different way, if you do not use maven):



          <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <version>2.3.0</version>
          </dependency>
          <dependency>
          <groupId>net.bytebuddy</groupId>
          <artifactId>byte-buddy</artifactId>
          <version>1.9.3</version>
          </dependency>


          and include them in module-info.java



          open module org.demo {
          ...
          requires java.xml.bind;
          requires net.bytebuddy;
          }





          share|improve this answer
























          • Thank you for your answer. Since I didn't get an answer for a long time, I went to a different route. I bypassed the problem, because I couldn't solve it. Maybe eventually I'll go back to the orginal (more suitable) solution, and try your suggestion.

            – Ádám Bozzay
            Nov 15 '18 at 14:56














          1












          1








          1







          You need to add these dependencies to pom.xml (or provide them in a different way, if you do not use maven):



          <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <version>2.3.0</version>
          </dependency>
          <dependency>
          <groupId>net.bytebuddy</groupId>
          <artifactId>byte-buddy</artifactId>
          <version>1.9.3</version>
          </dependency>


          and include them in module-info.java



          open module org.demo {
          ...
          requires java.xml.bind;
          requires net.bytebuddy;
          }





          share|improve this answer













          You need to add these dependencies to pom.xml (or provide them in a different way, if you do not use maven):



          <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <version>2.3.0</version>
          </dependency>
          <dependency>
          <groupId>net.bytebuddy</groupId>
          <artifactId>byte-buddy</artifactId>
          <version>1.9.3</version>
          </dependency>


          and include them in module-info.java



          open module org.demo {
          ...
          requires java.xml.bind;
          requires net.bytebuddy;
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 15 '18 at 10:58









          Konrad NaklickiKonrad Naklicki

          267




          267













          • Thank you for your answer. Since I didn't get an answer for a long time, I went to a different route. I bypassed the problem, because I couldn't solve it. Maybe eventually I'll go back to the orginal (more suitable) solution, and try your suggestion.

            – Ádám Bozzay
            Nov 15 '18 at 14:56



















          • Thank you for your answer. Since I didn't get an answer for a long time, I went to a different route. I bypassed the problem, because I couldn't solve it. Maybe eventually I'll go back to the orginal (more suitable) solution, and try your suggestion.

            – Ádám Bozzay
            Nov 15 '18 at 14:56

















          Thank you for your answer. Since I didn't get an answer for a long time, I went to a different route. I bypassed the problem, because I couldn't solve it. Maybe eventually I'll go back to the orginal (more suitable) solution, and try your suggestion.

          – Ádám Bozzay
          Nov 15 '18 at 14:56





          Thank you for your answer. Since I didn't get an answer for a long time, I went to a different route. I bypassed the problem, because I couldn't solve it. Maybe eventually I'll go back to the orginal (more suitable) solution, and try your suggestion.

          – Ádám Bozzay
          Nov 15 '18 at 14:56




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52413088%2funable-to-resolve-persistence-unit-root-url-in-java-9-multi-module-environment%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python