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

Injecting a Stateless EJB into another Stateless and using PersistenceContext

With JEE 5 / EJB 3.0 life of Java developers became much more easier. Later, influenced by Spring and CDI, similar approaches were also adopted in JEE. Now, I hope I am doing it right, but just to be sure: I have several Stateless EJBs, which all…
Alex Mi
  • 1,409
  • 2
  • 21
  • 35
0
votes
1 answer

XML document structures must start and end within the same entity

Getting the error while making a small project of inserting and retrieving data from database using technologies JAVA, JPA, MAVEN, MYSQL. Below is my code. This is my persistence.xml code:
Wic
  • 1
  • 2
0
votes
2 answers

How to write web.xml and persistence.xml to connect Java EE to DB Server

I aim something very simple - create an empty maven, download in pom - javaee-api, and then to connect this simple maven EE project - to DataBase Server - currently my local machine's MySLQ Server. I also aim to keep it simple - only with web.xml…
0
votes
1 answer

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

I have a little Java-project for my school. I use Eclipse Neon with JPA Diagram Editor and JavaFX. The problem -> when I set up the connection to the database, everything worked well (structure: project -> META-INF -> persistence.xml, generated…
0
votes
1 answer

How can I connect to two different databases, one for reading and one for writing in the same application using Spring?

Use Case: I am running a spring application which has orders. I can create plans for these orders. My dev environment/db does not have any orders and they come from a different application (we share the same db). So, Is there a way I can read orders…
Panic
  • 91
  • 11
0
votes
0 answers

List all databases in a server and choose to connect to one of them using java

I need your help writing my java program, I want a way to connect to a server without specifying the database. Then, execute a query on the server that lists the databases, the user chooses one, so the program connects to the chosen database. The…
0
votes
1 answer
0
votes
1 answer

Why Quarkus-Hibernate is looking for Persistance.xml when we have already given @DataSource?

I am trying to build hibernate project and i have mentioned properties in cron.expr=* 12 15 * *…
fatherazrael
  • 5,511
  • 16
  • 71
  • 155
0
votes
0 answers
0
votes
1 answer

Unable to build entity manager factory-Hibernet AWS

When I deploy work to EC2, AWS, I get that error, while trying to connect to RDS, however I am able to runt the same code locally pointing to the RDS and its wroking fine. below is my error.log from AWS. I suspect its something to do with POM. so I…
0
votes
0 answers

No Persistence provider for EntityManager - postgresql database

I've been trying to connect to a PostgreSQL Database and call a general namedQuery, but this is the error I've been getting: Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named…
0
votes
1 answer

NetBeans11.2 - JPA - java.lang.IllegalArgumentException: Object: javaapplication4.Id[ id=5 ] is not a known entity type

I am getting the following exception over and over trying to use JPA in NetBeans 11.2 on MacOS. java.lang.IllegalArgumentException: Object: javaapplication4.Id[ id=5 ] is not a known entity type. at…
0
votes
0 answers

Exception Illegal Argument - unknown entity JPA - Additional package to scan for entities in application-context.xml is not taken into consideration

I am working on a Spring application which has a persistence unit configured in the application-context.xml. I need to add an additional package in in order to use new entities. Even though this part of the persistence.xml file looks like below, my…
Maria1995
  • 439
  • 1
  • 5
  • 21
0
votes
1 answer

What is the cause of error "No META-INF/persistence.xml was found in classpath"?

Included all necesaary toplinks lib still getting following error on running example.java using netbeans 6.8 No META-INF/persistence.xml was found in classpath. Persistence.xml
Mayank
  • 1
  • 1
0
votes
1 answer

SeedStack "persistence.xml" not found using JPA add-on

I am setting up a SeedStack batch application and I am trying to use JPA without persistence.xml, but automatic JPA detection classes. However, I had theses exceptions: HHH000318: Could not find any META-INF/persistence.xml file in the classpath…