Questions tagged [persistence.xml]

Used with the Java Persistence API, specifies names and database properties.

When used with the Java Persistence API, the persistence.xml file is usually placed in the META-INF folder; it's used to specify the persistence provider name, entity class names, and properties like the database connection URL, driver, user, password, and so on (taken from http://www.javaworld.com/javaworld/jw-01-2008/jw-01-jpa1.html?page=3).

519 questions
2
votes
1 answer

How can I include lib into my embedded OpenLiberty jar?

I'm trying to set h2 database configuration in my OpenLiberty application. You could find the project in my Github account I use the maven profile OpenLiberty to build an embedded…
bmeynier
  • 289
  • 2
  • 12
2
votes
1 answer

No Persistence provider for EntityManager named xxxx

enter image description herecurrently Hibernate. I create simply project. I did everything as is in course but i get "No Persistence provider for EntityManager named xxxx". I dont know what is wrong. I find many solutions but none work with…
David W
  • 51
  • 2
  • 8
2
votes
1 answer

IntelliJ 2019.1 can't find persistence.xml (added to Project's Classpath)

To test a Hibernate/OGM/MongoDB Docker issue I've created a JUnit5 test. I've added the persistence.xml to the project in the folder: src/test/META-INF
NOTiFY
  • 1,255
  • 1
  • 20
  • 36
2
votes
1 answer
2
votes
0 answers

Cannot find the declaration of element persistence - but the XML is properly defined

I'm getting this problem when I try to deploy a war to a Tomcat 7 server: IllegalArgumentException: Invalid XML in persistence unit from URL [jar:file:/opt/webapps/foo/WEB-INF/lib/bar.jar!/META-INF/persistence.xml] SAXParseException; cvc-elt.1:…
AJPerez
  • 3,435
  • 10
  • 61
  • 91
2
votes
1 answer

Unable to resolve mapping file using Spring and JPA

I'm trying to integrate Spring with JPA. I have defined one entity and added as mapping file under persistence.xml, but it throws the exception Caused by: javax.persistence.PersistenceException: [PersistenceUnit: MyPersistence] Unable to resolve…
Yakhoob
  • 559
  • 1
  • 12
  • 32
2
votes
0 answers

Programmatically creating an EntityManagerFactory gives NullPointerException in wildfly

When programmatically creating an EntityManagerFactory, it produces a Nullpointer when the persistence.xml contains a node . I have tested this on Wildfly wildfly-10.1.0.Final. I have tried to update Hibernate…
Kevin Cruijssen
  • 9,153
  • 9
  • 61
  • 135
2
votes
2 answers

Deployed war to tomcat can't throws java.lang.NoClassDefFoundError: javax/persistence/PersistenceException

I'm new to this forum and also new to JPA / EJB. I'm trying to deploy a .war file containing a small application to a tomcat server. The application is using JTA to communicate with the Derby db. When I run and deploy the application from and…
user555346
  • 21
  • 1
  • 1
  • 2
2
votes
1 answer

persistence.xml for ejb deployed in glassfish

folks, i am trying to deploy a ear with a ejb in the ear root. the ejb has a persistence.xml file where the tag has to be a jar file in the Glassfish's domain lib. (this i have put it there because the jar is used across ears) so what exactly…
Rajan
  • 626
  • 3
  • 8
  • 18
2
votes
1 answer

JPA2.1/ Hibernate 5.2 using Hibernate Tools to generate ddl via an ANT Maven task

I have updated from Hibernate 4.3 to the latest version, currently 5.2.10.Final. I have the need for maven to generate the ddl schema so that when I run a drop database then create schema it will pick up the generated schmea which I am trying to get…
2
votes
1 answer

maven-antrun-plugin skips an execution

I added to my Maven project the solution advised in this Stack Overflow question. The only difference to the suggested solution that I introduced was to replace the with the (the issue I am experiencing appears with either).…
vasigorc
  • 882
  • 11
  • 22
2
votes
1 answer

persistence.xml not found on glassfish deployment descriptor (IntelliJ)

I have an EJB and a WEB module in my IntelliJ, created 5 entities that I would hope to load into a database using annotations. I go to project settings, under modules, and select that I want to add JPA facet, I know have a EJB, WEB and JPA facet. I…
user294937
  • 181
  • 13
2
votes
0 answers

Spring / HibernateJpaVendorAdapter under JPA 2.1 is not executing schema generation of Entity model / Metadata info

Spring / HibernateJpaVendorAdapter under JPA 2.1 is not the executing schema generation of Entity model / Metadata info. I have added two code snippets and the persistence.xml below. (Checkout my JPA 2.1 properties about schema generation... they…
user2120188
  • 427
  • 1
  • 4
  • 16
2
votes
1 answer

Hibernate Error java.lang.NoSuchMethodError

I'm using Jersey as Rest web service and Hibernate entity manager to persist JPA models. and I'm using Tomcat 8 as container. Here is the content of the persistence.xml file :
Mohamed Taboubi
  • 6,663
  • 11
  • 55
  • 87