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

No Persistence provider for EntityManager named... error

My persistence xml file is like that
ebruszl
  • 469
  • 4
  • 11
  • 27
2
votes
2 answers

Location of the persistence.xml in a Java Client App

I am a newbie in Hibernate. In order to get the transaction by the EntityManager, I need to use EntityManager Factory. When I put this code block on my file: EntityManagerFactory entityManagerFactory = Persistence …
EKO
  • 47
  • 1
  • 6
2
votes
0 answers

No persistence.xml file found in project

I'm using JBoss Developer Studio 7 (alpha) and have an EAR project with two WARs and one JAR. The JAR is a JPA project. The JAR contains all JPA Entities and also persistance.xml (inside META-INF folder). So I'd like to use the persitence unit…
Tvori
  • 298
  • 8
  • 19
2
votes
0 answers

JPA persistence.xml META-INF placement folder

I currently have my persistence.xml located in src/main/resources/META-INF/persistence.xml. Also I am using eclipselink 2.4 as my JPA 2.0 implementation. After publishing to the server and trying to run the app in the browser I get the following…
Padawan
  • 770
  • 1
  • 8
  • 18
2
votes
2 answers

Create Entity Manager Factory without persistence.xml

Is there a way to create the EntityManagerFactory without a persistence unit defined? Can you give all the required properties to create an entity manager factory? I need to create the EntityManagerFactory from the user's specified values at…
Gaurav Kumar
  • 323
  • 2
  • 4
  • 10
2
votes
1 answer

PSQLException: FATAL: database "mydb" does not exist

I'm having a weird problem with my app trying to connect to PostgreSQL with Jdbc driver version: 8.4-702.jdbc4 It seems it can't find the DB defined in the persistence.xml where it's there. Error: [INFO] Caused by: org.postgresql.util.PSQLException:…
quarks
  • 33,478
  • 73
  • 290
  • 513
2
votes
1 answer

Jboss Services failed to start: service jboss.persistenceunit

For some reason I'm not able to deploy my project anymore. I get the following error message: 23:03:58,847 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA 23:03:59,219 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA 23:03:59,276 INFO …
Lama
  • 2,886
  • 6
  • 43
  • 59
2
votes
3 answers

How to work with javax.persistence.sql-load-script-source?

I want to automatically insert data into my MySQL tables. Therefore I try to use the JPA property "javax.persistence.sql-load-script-source" in my persistence.xml:
Benny Code
  • 51,456
  • 28
  • 233
  • 198
2
votes
1 answer

Glassfish 3.1.2 "Could not resolve a persistence unit corresponding to the persistence-context-ref-name"

My project has the following structure: EAR (derp.ear) | |____ derp-ui.war | |____ busctrl.jar | |____META-INF | | _______ persistence.xml (persistence name of "DEJPA") The…
8bitjunkie
  • 12,793
  • 9
  • 57
  • 70
2
votes
3 answers

EclipseLink - No [EntityType] was found for the key class [CurriculumTree] in the metamodel

I get the following in my axis2 web service after deploying into tomcat. java.lang.IllegalArgumentException: No [EntityType] was found for the key class [VOs.CurriculumTree] in the Metamodel - please verify that the [Entity] class was referenced in…
jaykumarark
  • 2,359
  • 6
  • 35
  • 53
2
votes
0 answers

entity class from database wizard hangs

I'm developing a web app using Netbeans 7.3, Glassfish server and SQL Server 2008 (Schema named dbo and is 65 gigabytes). I've connected to the database (in the "Services" tab) and now I am trying to create a persistence.xml using the…
2
votes
0 answers

OpenJPA SynchronizeMappings in persistence.xml only to the managed tables

I have read many tutorials about the SynchronizeMappings options in persistence.xml. The configuration I have concluded is this one:
Yiannis Gkoufas
  • 660
  • 6
  • 16
2
votes
0 answers

hibernate using jpa and glassfish 3.0.1

hello all i am using hibernate using jpa in my project and accessing dao's like new (dao name).(methdoname)... eg. new OrdersDao().createOrder() so i would like to ask you is it a good practice to use it this way..or if something else then please…
user1918096
  • 153
  • 1
  • 3
  • 10
2
votes
1 answer

EntityManager JNDI - name not found

Hi I created a JNDI resource on Tomcat 7 server and I'm trying to use it through persistence.xml, but I got an error that the resource name is not found in the context. I tried other solution found on net, but no worked for me. Anybody see what is…
plewand
  • 156
  • 1
  • 9
2
votes
1 answer

Java persistence.xml multiple persistence-unit "cannot find symbol ... import"

i got a Problem with my NetBeans-Maven-Project. If i add another Persistence-Unit into the same persistence.xml with the same Entities, i get some Exceptions i dont understand.
Zack
  • 51
  • 1
  • 5