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

How to solve persistence.xml problem with child module?

I have created a project using maven. I have also created two child modules of this project. The structure is like this : --parentModule --childModule-backend --childModule-frontend The application server i have is wildfly 12. I have defined the…
Nana
  • 55
  • 8
0
votes
1 answer

Caused by: javax.persistence.PersistenceException: Invalid persistence.xml. Cannot find the declaration of element 'persistence'

I am currently working on an Enterprise Application and I am having problems setting up the entitymanagerfactory. I keep getting this message. 10:26:37,661 ERROR [org.jboss.ejb3.invocation] (http-localhost-127.0.0.1-8080-2) JBAS014134: EJB…
0
votes
2 answers

EclipseLink: Inheritance with mongoDB as persistence layer

I'm trying to setup a webapp with Jersey using a MongoDB as persistence layer. My JPA framework is EclipseLink. I've run into a problem with persisting objects which classes are extending other (abstract) classes. For example given the following…
Scyla101
  • 230
  • 3
  • 18
0
votes
1 answer

Multiple entityManagerFactory without persistence.xml

I've been working in a project that has been using spring mvc 4 and JPA configuration beans are created in java class without persistence.xml just like the code below. package test.conf; import java.util.Properties; import…
marionmaiden
  • 3,250
  • 8
  • 33
  • 50
0
votes
0 answers

PersistenceUnit already registered

While trying to deploy my war file into Jboss 6.4 server I am getting the following error, I googled it but mostly every one says make sure you are running single instance of Jboss, I am running single instance of Jboss and single…
0
votes
2 answers

Can't figure it out how to resolve javax.persistence.PersistenceException

We are trying to build a JSF application with JPA. For now, we want to make the login feature, but when we run the application on our glassfish server, there is the exception: javax.persistence.PersistenceException: No Persistence provider for…
DaJackal
  • 2,085
  • 4
  • 32
  • 48
0
votes
0 answers

OpenJPA does not find Entities

I am currently using OpenJPA in one of my projects and got yet another problem. I defined some entities in my persistence.xml but OpenJPA doesnt seem to find them. While running my project I got this warning for every single entity registered in my…
Demli95
  • 136
  • 1
  • 12
0
votes
1 answer

SQLException - No suitable driver found for jdbc:postgresql

I have a problem. I'm created EntityManager with credentials of Persistence.xml but I give message error "No suitable driver found for jdbc:postgresql/localhost:9999/DB". I do not understand what I'm doing wrong, could you help me or give me advice…
rodrixd
  • 510
  • 2
  • 6
  • 15
0
votes
1 answer

Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.hibernate.ejb.HibernatePersistence]

I am new on spring. I have got the error below when following a tp. I am testing with Junit a connection to a mysql DB. I use the framework Hibernate to manage the connection. The error java.lang.AssertionError: Error creating bean with name…
AaronLbk
  • 41
  • 2
  • 10
0
votes
0 answers

How to configure persistence.xml in Java project (without Spring) to use the cleardb_database_url in heroku

I need advise how to configure persistence.xml in Java web project (without Spring) to use the cleardb_database_url so I could deploy succesffuly my database application to Heroku. I have found at Heroku site documentation how to use xml for…
Sandra
  • 1
  • 1
0
votes
1 answer

Unable to bind services dynamically in Osgi Blueprint

I'm new to OSGI Blueprint and facing a strange issue. I have 2 separate Databases: oracle and h2(to be used for testing) db The blueprint container looks something like this:
Sandy
  • 459
  • 2
  • 6
  • 19
0
votes
2 answers

Define variables in gradle to fill data in persistence.xml

Can I define variables in gradle, which are fill in the placeholders in the persistence.xml? Example gradle.properties: dev.classes= my.package.class.....my.package.class persistence.xml
Paddy3108
  • 33
  • 1
  • 6
0
votes
1 answer

how to load JPA jar with persistence.xml from outside of war file in jboss

I have JPA jar with persistence.xml and want to deploy in Jboss7. Problem is that, i can't put inside WAR file(i know we can load from war file). I have created module in jboss and placed jar file with including persistence.xml file inside META-INF\…
Yugandhar
  • 333
  • 1
  • 4
  • 13
0
votes
0 answers

JPA 2.1 testing: persisting the pre-loaded data

I'm testing my JPA classes using Arquillian against "remote" containers (Glassfish 4 and WildFly 10, to be specific). I want to: Generate the database schema from the JPA entities' definitions (as opposed to SQL scripts). Pre-load some data to…
badbishop
  • 1,281
  • 2
  • 18
  • 38
0
votes
0 answers

How to support different Databases without the need to rebuild

Why do I need to configure the SQL dialect of a data source? argues that one must define the hibernate.dialect. But, if hiberate.dialect is defined within persistence.xml, I have to decide at build time, which database is to be used. What can be…
Frank Neblung
  • 3,047
  • 17
  • 34