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
5
votes
7 answers

persistence.xml not found in Eclipse Maven Project

I cannot fix the persistence.xml file not found eclipse problem, this is a simple test project (Maven Nature) for a very basic EJB testing, the file is indeed in src/main/resources/META-INF/... this is the pom.xml contents. Tried adding the folder…
JuanBruno2013
  • 51
  • 1
  • 1
  • 2
5
votes
1 answer

Using Connection Pool in JPA

I hava a standalone JPA (Hibernate) - MySQL Application. My persistence.xml looks like:
Jasper
  • 8,440
  • 31
  • 92
  • 133
5
votes
2 answers

Hibernate 4.1.9 c3p0 settings, and way too many connections to database

I'm using Hibernate 4.1.9 in a Java web application (that uses a Oracle 11g database) and seem to be getting some run-away connections even though i'm using c3p0 pooling. it seems this should be managed in my config file with the appropriate…
russellelbert
  • 643
  • 4
  • 9
  • 23
5
votes
1 answer

Hibernate JPA how to configure dynamic-update in persistence.xml

I do NOT want to configure in my java source code which can be done like: @org.hibernate.annotations.Entity( dynamicUpdate = true) because I want it to be configurable. I am not using hibernate.properties, only persistence.xml as I am…
Deepak Singhal
  • 10,568
  • 11
  • 59
  • 98
4
votes
1 answer

No Persistence provider for EntityManager named

I got the error "No Persistence provider for EntityManager named projectPersistence org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:288) " while I'm running my project on the server.…
observer
  • 725
  • 4
  • 10
  • 20
4
votes
2 answers

OpenJPA 2.1.1 - Cannot find the declaration of element 'persistence'

I just downloaded http://www.apache.org/dyn/closer.cgi/openejb/4.0.0-beta-1/apache-tomee-1.0.0-beta-1-webprofile.zip to use OpenEJB with OpenJPA2.1.1. I can't get my persistence.xml working. The top of the stack trace: org.xml.sax.SAXException: …
user1071419
  • 41
  • 1
  • 3
4
votes
3 answers

Understanding Persistence.xml in JPA

I am trying to understand the following things: When I make an EJB project and deploys it to Glassfish do I set up JDBC resources/connection pools at the administrator center of Glassfish or do I add all the different properites for username,…
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
4
votes
3 answers

using Spring's persistenceXmlLocation without in persistence.xml

My question: Is there a way to tell Spring/JPA to automatically detect classes annotated with @Entity? Background: This is my configuration of the entityManagerFactory
Ethan Leroy
  • 15,804
  • 9
  • 41
  • 63
4
votes
1 answer

persistence.xml not getting added in ear

We have a maven project with ejbs and stuff. When i run a build and create my ear, the persistence.xml doesnt get included inside the ear. What could be wrong here?
Sripaul
  • 2,227
  • 9
  • 36
  • 60
4
votes
2 answers

JPA persistence.xml

Is there a way to make the data on the persistence.xml dynamic? I was thinking of adding a database name property on my properties file, then the tables are created, if not existing. Is this possible? I'm using EclipseLink(JPA2.0) and MySQL.
Cyril Horad
  • 1,555
  • 3
  • 23
  • 35
4
votes
0 answers

Initialize Log4j2 JPAAppender with Spring instead of in persistence.xml

I'm interested in using Log4j2's JPAAppender for logging. See https://logging.apache.org/log4j/2.x/manual/appenders.html#JPAAppender In the docs it states that this should be configured in an own persistenceunit besides the main one you're using…
Beamie
  • 647
  • 7
  • 23
4
votes
1 answer

persistence.xml property values from properties file

I have below configuration for entityManger
user3552454
  • 171
  • 1
  • 3
  • 13
4
votes
1 answer

Tell gradle to pick persistence.xml from src/test/resources instead of src/main/resources

I have a Gradle java web project being developed to run in Wildfly with the following structure: - src/main/java - src/main/resources \-- META/INF \-- persistence.xml - src/test/java - stc/test/resources \-- META/INF \--…
Bruno Gasparotto
  • 671
  • 12
  • 31
4
votes
2 answers
4
votes
1 answer

java persistence collection of metamodel types is empty

While deploying my jpa project to wildfly server i am gettings following warning: The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence…
Jayendra Gothi
  • 682
  • 2
  • 11
  • 26