javax.persistence.PersistenceException: Unable to resolve persistence unit root URL


Solutions on the web

Solution icon of stackoverflow
Unable to resolve persistence unit root URL

Solution icon of github
Unable to build the entity manager factory for persistence unit: default

Solution icon of stackoverflow
[PersistenceUnit:default] Unable to build EntityManagerFactory

Solution icon of github
via GitHub by deepu105
, 1 year ago
[PersistenceUnit: default] Unable to build Hibernate SessionFactory

Solution icon of web
[PersistenceUnit: default] Unable to build Hibernate SessionFactory

Solution icon of web
[PersistenceUnit: default] Unable to build EntityManagerFactory

Solution icon of stackoverflow
via Stack Overflow by Sandra
, 1 year ago
[PersistenceUnit: default] Unable to build Hibernate SessionFactory

Solution icon of stackoverflow
[PersistenceUnit: freedompop] Unable to build Hibernate SessionFactory

Solution icon of stackoverflow
[PersistenceUnit: default] Unable to build Hibernate SessionFactory

Solution icon of web
[PersistenceUni t: default] Unable to build EntityManagerFactory

Stack trace

javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076)[spring-context-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:851)[spring-context-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)[spring-context-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
	at kg.nurtelecom.PdfReportApplication.main(PdfReportApplication.java:31)[classes!/:0.0.1-SNAPSHOT]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_101]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_101]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[na:1.8.0_101]
	at java.lang.reflect.Method.invoke(Unknown Source)[na:1.8.0_101]
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)[BillingInvoiceGenerator-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)[BillingInvoiceGenerator-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)[BillingInvoiceGenerator-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)[BillingInvoiceGenerator-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
Caused by: javax.persistence.PersistenceException: Unable to resolve persistence unit root URL
	at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl(DefaultPersistenceUnitManager.java:603)[spring-orm-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:443)[spring-orm-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.afterPropertiesSet(DefaultPersistenceUnitManager.java:424)[spring-orm-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:310)[spring-orm-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:373)[spring-orm-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:362)[spring-orm-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
	... 24 more
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)[spring-core-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 3 weeks ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
21 more bugmates