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
0
votes
1 answer

Jakarta EE Persistence: tables not showing in DB for new entities registered in persistence.xml

I am currently studying a postgrad software development course, and the current part of the course involves setting up a Jakarta EE project utilising Persistence and JSF to create a basic application to enable CRUD operations on entities through a…
0
votes
1 answer

org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "CREATE FUNCTION"

I am trying to create a function that calculates the distance between 2 points (longitude and latitude wise) using an SQL script while running the application by specifying in the persistence.xml
hajjoujti
  • 3
  • 3
0
votes
1 answer

What should be the correct path of jar file in persistence.xml

I have a jar file and persitence.xml in META-INF in that jar file. I want to configure the persistence.xml with . Also I have a lib directory on the same folder with jar file. But I am not able find correct path for tag. I…
xxlali
  • 996
  • 2
  • 15
  • 43
0
votes
1 answer

Persistence Exception No Persistence provider for EntityManager named

I'm trying to test my hibernate-maven app in Eclipse and when I run the method that get the name of the enttity class I get this exception: jun. 01, 2021 9:52:51 P. M. …
reymagnus
  • 327
  • 2
  • 17
0
votes
0 answers

Hibernate doesn't find annotated class

I use JAVA SE and Hibernate. I have a package with annotated class name Message (with javax @Entity annotation). my persistence.xml is very simple:
user1409534
  • 2,140
  • 4
  • 27
  • 33
0
votes
1 answer

Hibernate Output in console is yet visible

i have a strange problem with hibernate. I want to avoid the output from hibernate, than i have changed my logback.xml and persistence.xml file, in order to make that. persistence.xml
0
votes
1 answer

JPA always fails to create (H2) database schema and tables when using DDL scripts

I'm using JPA on a standard Java project. I have a persistence.xml deployment descriptor that looks like:
x80486
  • 6,627
  • 5
  • 52
  • 111
0
votes
2 answers

JPA Hibernate login to local MySQL in IntelliJ not working

I am new to Jakarta EE, I have seen some other similar questions, I have followed them but can't seem to see what I am doing wrong as I have followed all those. Seems like the class com.mysql.jdbc.Driver is not found. Im banging my head on the wall…
ptmp_727
  • 65
  • 9
0
votes
1 answer

how can I set value dynamic in persistence.xml file

I'm working in on spring boot project ( with maven) I have a file application.properties for config like this: jdbc.username=postgres jdbc.password=40love In persistence.xml file instead of using the username and password like this :
0
votes
0 answers

Wildfly 22.0.1 Fails to deploy EAR with a MariaDB datasource

I have installed Wildfly 22.0.1. I added a MariaDB connector and a datasource in the standalone.xml: jdbc:mariadb://localhost/tube
Dobbo
  • 1,188
  • 3
  • 16
  • 27
0
votes
1 answer

Error parsing the persistence.xml(org.hibernate.MappingException)

I am using JPA and I tried to put my configuration data in the persistence.xml file. But when I run the app, the error is as follows: [hibernatetool] org.hibernate.MappingException: invalid configuration [hibernatetool]…
xiaohan2012
  • 9,870
  • 23
  • 67
  • 101
0
votes
1 answer

Issue in persistence.xml for Oracle DB

I am getting below error :org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 77; schema_reference.4: Failed to read schema document 'http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd', because 1) could not find the document; 2)…
Gps
  • 31
  • 1
  • 5
0
votes
0 answers

I'm getting an exception in javax.persistance when trying to connect my entity class to mySQL using JPA. How do I fix it?

I'm trying to create a simple user entity class and add the tables to the mysql database but I'm getting the following error when I run the class. Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for…
rianne
  • 31
  • 1
  • 5
0
votes
1 answer

How do I connect to multiple databases using JPA Glassfish Java EE?

I have an application using JSF,EJB,JPA, Glassfish. There are multiple(may be around thousand or more) clients using my app, however each client has a separate database. All the databases have the same schema. I would like to determine which…
paawan
  • 111
  • 1
  • 2
  • 13
0
votes
1 answer

Change hibernate JPA properties at runtime

I usually use a persistence.xml to configure hibernate, via properties like
MetaColon
  • 2,895
  • 3
  • 16
  • 38