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

TomEE + OpenJPA - can't inject EntityManagerFactory PersistenceUnit

I have a stateless EJB that injects @PersistenceUnit private EntityManagerFactory factory My persistence.xml:
Aviram
  • 553
  • 1
  • 8
  • 21
1
vote
1 answer

add EJB into maven project with hibernate

I created my project as "maven project" and I use JSF with beans (defined in faces-config.xml). Right now I'm using my beans to access my DAO object which communicate with DB. I want to add EJBs in my project but I am kind of stuck. In my POJOs i'm…
1
vote
1 answer

DataNucleus persistence.xml filtering: No "persistence.xml" files were found in the CLASSPATH

Whenever I enable (Maven) filtering of the persistence.xml file I get the following error: SEVERE: DataNucleus Enhancer completed with an error. Please review the enhancer log for full details. Some classes may have been enhanced but some caused…
AndrewBourgeois
  • 2,634
  • 7
  • 41
  • 58
1
vote
3 answers

How to store persistence.xml with other configuration files

I'm using EclipseLink as my JPA implementation. Our project has a directory where we keep all of our config files, and I would like to store my persistence.xml file in the config directory, but cannot find any way to tell createEntityManagerFactory…
BostonJohn
  • 2,631
  • 2
  • 26
  • 48
1
vote
1 answer

JPA Spring MVC configuration

I am trying to connect to MySQL db using JPA and Spring. I am new to Spring. I have added this to my config file where all the beans are defined:
Sara
  • 2,417
  • 7
  • 35
  • 52
1
vote
1 answer

JPA with Eclipselink MySQL jdbc in Eclipse RAP/RCP

System overview: Eclipse Indigo for RAP RCP devs, RAP 1.4 Target Components, Dali JPA, Jre1.6.0_33 (Java1.6SE) local oracle mysql db all JPA (Persistence) + Eclipse link OSGi bundles imported in project (according to eclipse wiki) OSGi bundle…
To Kra
  • 3,344
  • 3
  • 38
  • 45
1
vote
1 answer

How to quickly generate persistence.xml from jpa/hibernate classes

It is sometimes tedious to add class names manually to the persistence.xml file for hibernate configuration. Is there a way to quickly generate the com.something.Entity1 part of the file?
lawal
  • 952
  • 10
  • 19
1
vote
1 answer

How I can do to read the tag value for my persistence.xml in from a file config.properties

I want to do something like this: config.properties: dsname=value; anotherValue=anotherValue; persitence.xml ${dsname}
Carlos Laspina
  • 2,013
  • 4
  • 27
  • 44
1
vote
2 answers

EntityManagerFactory not being injected using @PersistenceUnit

I'm a java beginner. I'm in trouble to configure a persistance unit using JTA transactions. I need to use a PostgreSQL database that is already defined, configured and populated. Using netbeans, i created the persistance.xml and…
Pedro Peixoto
  • 219
  • 2
  • 6
  • 16
1
vote
1 answer

EJB can't find Optional Package and thus Persistence Unit in it

Environment WebLogic 11g (consequently Java EE 5 and EJB 3.0) An EJB contained JAR that also holds all persistence Entities. It worked fine (have a web app that uses the EJB and it works as expected). I decided to separate Entities to another layer…
Amir Keibi
  • 1,991
  • 28
  • 45
0
votes
1 answer

multiple EJB jar file inside one EAR sharing the same persistence.xml

I am using JBoss 4.2.3 application server. I have an EAR that currently contains 2 EJB (EJB 3) jars. In the main EJB jar I have persistence.xml file with the data source configurations. From the secondary EJB jar file I can successfully call the the…
Eli Avital
  • 21
  • 1
  • 3
0
votes
1 answer

Integration Testing an OpenJPA Data Access Object or Service Facade?

I have a project I'm building using struts2 and openJPA. I want to do some integration testing but I seem to be having an issue getting it to work. persistence.xml
Alan B. Dee
  • 5,490
  • 4
  • 34
  • 29
0
votes
1 answer

How do I configure persistence.xml for ORM on glassfish v3 with Derby and Eclipselink

I'm using the internal glassfish 3.1 plugin for Eclipse, along with a derby database I installed (it shows up on the datasource explorer in the Database Developer view in Eclipse), and I'm fumbling at the "last" step of getting the ORM working so…
Jazzepi
  • 5,259
  • 11
  • 55
  • 81
0
votes
2 answers

how can get the datasource configuration for spring from persistence.xml?

I need a spring datasource like:
caeycae
  • 1,137
  • 3
  • 12
  • 28
0
votes
1 answer

toplink sequencing jumps by preallocation size

We have an application where we use table sequencing.Everytime we bounce the server the sequence number( here SEQ_R) in the table acts weird.The sequence number gets incremented by 90000 and at times by 50.Where, the increment should be by 1. I have…