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

problem with jpa, persistence.xml, glassfish netbeans ide postgresql db pool an jdbc resource and jta

I'm running : so: linux ubuntu 17 db: postgresql java 8 netbeans ide 8 I'm triying a jpa application in j2ee but with problem with the jta reference to my connection pool configured in glassfish I've configured a…
jcs
  • 1
0
votes
1 answer

Can I have two persistence.xml files in my spring maven project

Is it possible for me to have two different persistence.xml files under META-INF eg. persistence-one.xml and persistence-two.xml and then somehow use in my…
Naxi
  • 1,504
  • 5
  • 33
  • 72
0
votes
1 answer

How to fix 'Unable to retrieve EntityManagerFactory for unitName null'

I am using Glassfish 5.0 with a Java Web App built in Maven framework. I have set up the Connection Pool and it is connected when you ping it. I have placed the persistent.xml file in src/main/java/META-INF with the config:
0
votes
1 answer

Why does my Java app work in local but when delivering to IBM Cloud it gives this error

I have created an app that uses JPA as well as servlets with JAX-RS. When I run the app locally, I am able to query my server with curl and get the proper response for all the GET and POST requests. However, when I host the server on IBM Cloud and…
edoreld
  • 303
  • 1
  • 17
0
votes
0 answers

How can i connect 3 class to each other with using annotations?(JPA/Spring-Boot)

I'm working on Spring Boot project. I have class as you see below. When i run project it give me error like that "Unable to open JDBC Connection for DDL execution". I know that my problem depent to "annotation". How can reach good solution which…
0
votes
1 answer

Expose container managed EntityManger/EntityManagerFactory/PersistenceContext to JNDI

As the title says, I'd like to know if it's possible to lookup the container managed EntityManger (or EntityManagerFactory or PersistenceContext) through JNDI in an enterprise application deployed on Websphere Application Server ver. 8.5 or 9.0…
dekkard
  • 6,121
  • 1
  • 16
  • 26
0
votes
0 answers

persistence.xml not found when deploying EAR into OpenEJB with Arquillian

I'm trying to run an integration test with Arquillian using OpenEJB embedded as environment, but the deployment fails due to missing persistence.xml. This is being run in a module ("services") of a multi-module maven project. The module is being…
0
votes
1 answer

EntityManagerFactory and DB schema (persistence provider: Hibernate 5.3.7) is initialized twice on Weblogic 12.2.1.3

I am using Hibernate 5.3.7.Final as persistence provider on Weblogic 12.2.1.3. My problem is, that when I deploy my application which contains the persistence unit, the entity manager factory is initialized twice by Weblogic. First in the…
0
votes
0 answers

@PersistenceContext With 'Provided' Scope RestController

I was having a look at a codebase at my company today morning and to me, it wasn't something very obvious. I have worked with Spring MVC enterprise projects but in my experience, I never had to use the prototype Scope. I have seen its usage in some…
gursahib.singh.sahni
  • 1,559
  • 3
  • 26
  • 51
0
votes
0 answers

MyBatis Insert a complex object which has associations

Hi Guys i have a complex object as below and would like to know how to write mapper.xml for the same. I have knowledge to insert a simple object, but i am not getting this with 2 levels of Hierarchy. Below is my domain object class Org{ id=O1 …
Punith Raj
  • 2,164
  • 3
  • 27
  • 45
0
votes
1 answer

How to configure persistance.xml file in SpringBoot project

I created one spring boot application. When I run this I am getting below error for persiatance.xml. Seems like it is not reading my persistance.xml file. Could you please help me in resolving the issue. Exception in thread "main"…
G.Chahar
  • 185
  • 6
  • 19
0
votes
0 answers

Hibernate not scannig external Entity classes that are bundled in a jar

I am currently working on a web project where i am using hibernate.cfg.xml. Now i a planning to move all entity model classes to a separate jar and then refer the entites from the external jar. Also I am not using Entity Manager anywhere. Am using…
Shivani Bhansali
  • 109
  • 1
  • 12
0
votes
0 answers

Wildfly 10 Deployment Error WFLYCTL0184: New missing/unsatisfied dependencies

We are migrating JBoss AS 7.0.2 to Wildfly-10.0.0.Final. We have faced some of the dependencies problem while deploying the web application. When I start deploying my app, it return me the error specified in the title with the following... Jboss Log…
0
votes
0 answers

Error: javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258)

I am new to JPA and I have a database UserRecords with USER_ID as my primary key and I have set it to auto increment. However, whenever I run the program it gives me the error: javax.persistence.RollbackException: Exception [EclipseLink-4002]…
rajput sufiyaan
  • 61
  • 1
  • 14
0
votes
1 answer

How to load persistence.xml?

What I really want to do is to enumerate all the persistence units (PUs) declared for an application. Since some answer in StackOverflow says such a service does not exist in JPA, the option seems to be parsing the persistence.xml file myself and…
AlexSC
  • 1,823
  • 3
  • 28
  • 54