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
2 answers

When scanning too many entity in jpa hibernate, glassfish startup very slow or memorry leak

I'm using JavaEE7, hibernate-jpa2.1 My project have too many entity ( approximately 2000 entity) If it only have 100 objects entity, it startup normal. But now I've added all my business entity classes (2000) and I get a pergem space error. …
anhdv
  • 11
  • 2
1
vote
0 answers

Can't insert data into database through persistence.xml file

I have created a PostgreSQL script just to insert a row in the customer table. The insert happens when my project is starting to run. But it doesn't work because I'm getting the following error: [EL Warning]: 2016-10-23…
superkytoz
  • 1,267
  • 4
  • 23
  • 43
1
vote
2 answers

JEE7/JAX-RS How to programatically create a JDBC connectionpool

I'm currently developing a REST service to replace an existing solution. I'm using plain Payara/JEE7/JAX-RS. I am not using Spring and I do not intent to. The problem I'm facing is that we want to reuse as much of the original configuration as…
Brixomatic
  • 381
  • 4
  • 16
1
vote
1 answer

Could not find any META-INF/persistence.xml file in the classpath on WebProject

After thoroughly searching this forums looking for an answer, I couldn't find a single case similar to mine. After generating the WAR filer using maven and deploying my server, everytime I send a GET request to a API that needs to create a DAO I get…
1
vote
1 answer

OpenJPA > Is it possible to define persistence xml file somewhere else than META-INF with name persistence.xml

I am a new OpenJPA 2.2.2 user. I noticed that the database configuration has to be defined in META-INF/persistence.xml. This sounds to be too inflexible. Moreover, I found from the OpenJPA 2.2.2 documentation: The OpenJPA runtime includes a…
Rui
  • 3,454
  • 6
  • 37
  • 70
1
vote
0 answers

Where are persistence units in gs-accessing-data-jpa sample?

Here is an example of accessing Data with Spring JPA: http://spring.io/guides/gs/accessing-data-jpa/ Where are any persistence units and/or persistence.xml files there?
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
1
vote
1 answer

org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 18; cvc-complex-type.2.4.a: Invalid content was found starting with element 'properties'

I did following tutorial link here and I am getting Caused by: org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 18; cvc-complex-type.2.4.a: Invalid content was found starting with element 'properties'. One of…
John Doe
  • 13
  • 3
1
vote
1 answer

How to specify a jdbc.url in the persistence.xml relative to the application folder?

Once I deploy my application with JPA the user chooses to install it somewhere. Then however the property set as: gets interpreted into the following…
simpatico
  • 10,709
  • 20
  • 81
  • 126
1
vote
2 answers

Setting vsession.program in java app using hibernate 5 and c3po connection pool

I'm trying to set the session program name from my java app. I'm using an entity manager passing the connection credentials from user input. I need to be able to set the program name in the oracle session when connected. Right now it only appears as…
speedos82
  • 97
  • 1
  • 2
  • 7
1
vote
3 answers

Insert Null Struct using EclipseLink JPA

I have an Oracle table with an SDO_GEOMETRY column and I am trying to use EclipseLink JPA2 2.6.1 for persistence. My entity class uses a JTS Geometry for geometry objects and I have written a AttributeConverter to convert from a SDO_GEOMETRY to a…
1
vote
1 answer

persistence is not using a given port to connect with MySQL DB

I'm trying to connect from my JEE app to mysql database- During deployment I'm getting an error -connection refused (but with information that refused on 1527 port). I can't get what is wrong, and why there is a try to connect to my database on…
Krystian
  • 2,221
  • 1
  • 26
  • 41
1
vote
1 answer

How to use SQLite database with path relative to project/application?

My project uses the Maven build manager along with JPA and EclipseLink for interaction with a SQLite databse. The IDE of choice is NetBeans. This question however should not be anchored to the IDE but to the application that is developed in it. I…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
1
vote
0 answers

Error with OpenJPA and processing a class

This is the error shown: exception org.apache.openjpa.persistence.ArgumentException: An error occurred while processing registered class "class no.avexis.fjellkam.Models.Cabin". …
Patidati
  • 1,048
  • 2
  • 12
  • 19
1
vote
1 answer

switching jpa 2.1 schema generation per maven profile

In my jpa app i want to switch ddl schema generation per profile. For schema generation enabled i need additional lines:
dermoritz
  • 12,519
  • 25
  • 97
  • 185
1
vote
1 answer

All I want is to access a H2 mem database in Websphere V8 using JPA 2.0

I've been struggling with this for days now and I searched dozens of articles in StackOverflow and other dev sites. I used the Deployment Manager interface to configure a Websphere Application Server 8.0.0.3 with a H2 JDBC provider and a Data Source…
herbae
  • 73
  • 8