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
1
vote
1 answer

Guice JpaRepositoryModule with multiple Persistence Units

I've declared my 2 PUs on persistence.xml as below: org.hibernate.ejb.HibernatePersistence
1
vote
2 answers

Error java.lang.InstantiationException

I'm trying to create a project with glassfish JSF and JPA, but I'm having trouble with the persistence unit in the persistence.xml file. The error is the following: GlassFish 3.1 at localhost 2014-05-06T12:47:52.326-0300|INFO: Initializing Mojarra…
Patterson
  • 326
  • 1
  • 7
  • 19
1
vote
1 answer

JUnit and Spring: Cannot find persistence.xml - but it does exist

I'm trying to get JUnit to run, but it keeps throwing the following error: class path resource [META-INF/persistence.xml] cannot be opened because it does not exist The entire stacktrace can be found here: http://codepad.org/OhlyjQKn. It is a…
Sam
  • 776
  • 2
  • 8
  • 22
1
vote
1 answer

Encrypting Parameters in persistence.xml

We have a batch application using OpenJPA. We are specifying all the DB connection parameters in persistence.xml. Although its a functional setup it looks very insecure to have all the ip,username,password in clear text and a serious concern in…
Barun
  • 503
  • 5
  • 13
  • 22
1
vote
0 answers

Specify DB2 driver properties in persitence.xml

I have a question regarding driver specific properties in the persistence.xml. DB2 has some secific properties that need to be set on the DataSource see: com.ibm.db2.jcc.DB2SimpleDataSource ds = new…
exor298
  • 11
  • 1
  • 2
1
vote
1 answer

ObjectDB: Persistence Exception type not found error 301

while following this tutorial: http://www.objectdb.com/tutorial/jpa/eclipse I receive the following error: Exception in thread "main" [ObjectDB 2.5.4_05] javax.persistence.PersistenceException Type tutorial.model.Point is not found (error 301) at…
Zac Lozano
  • 778
  • 1
  • 4
  • 12
1
vote
1 answer

producing EntityManager throws __FIRST_PHASE__ is missing

Here's my error ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "test.war")]) - failure description: {"JBAS014771: Services with…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
1
vote
1 answer

Transaction realization in JPA

I'm trying to understand what is transaction in JPA. Say I have an application deployed to glassfish with persistence:
corvax
  • 1,095
  • 1
  • 10
  • 35
1
vote
0 answers

Why jndi-lookup is not creating a EntityManagerFactory bean definition from JNDI?

I created my app as J2EE app in JDeveloper 11g. It uses JSF 2.1, Spring-core 3.2.1 and Spring-data-jpa-1.4.4 among others Spring necesary modules. I've created a datasource in the integrated WebLogic server within the default domain. When I try to…
1
vote
1 answer

JPA persistence unit into file?

I use JPA to persist my data to a MySQL database and it all works pretty fine. Now I need to store a couple of configurations on the system the program is executed from. In past I would have created a settings.ini or a settings.xml file and pretty…
Socrates
  • 8,724
  • 25
  • 66
  • 113
1
vote
0 answers

Using JPA (application managed) packed in a jar

We are creating a portlet with persistence layer (jpa/eclipselink) delivered by a jar (a 2nd maven module). parent |---portlet-module (war) |---persistence-module (jar) The idea was to completely encapsulate the persistence layer and only…
dermoritz
  • 12,519
  • 25
  • 97
  • 185
1
vote
2 answers

Kundera No Entity metadata found for the class

I get an error "No Entity metadata found for the class" using Kundera a similiar question is here, No Entity metadata found for the class but didn't find an answer (answer put META-INF into classes dir, didn't help me. This is the error I get 3168…
1
vote
0 answers

Reusing persistence.xml between JavaEE and JavaSE environments

I am doing JPA development mainly under WebSphere 7.0, which uses OpenJPA as its JPA provider. I have the following persistence.xml file:
Isaac
  • 16,458
  • 5
  • 57
  • 81
1
vote
1 answer

persistence.xml in a Spring application

I'm used to have persistence.xml in my projects in which I define the provider to use (hibernate in most cases). However, I'm starting a new project in which it is mandatory to use Spring framework. I've seen some blogs describing the integration…
javaxiss
  • 680
  • 3
  • 13
  • 34
1
vote
2 answers

Add persistence.xml file in Maven project from IntelliJ IDEA

How to add persistence.xml file in Maven project from IntelliJ Idea? I am using IntelliJ Idea 12 and have created maven project with two modules. Suppose, ModuleA (parent-maven) and ModuleB (child-maven). I want to add persistence.xml file into the…
yonjans
  • 151
  • 3
  • 10