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

Persistence deployment issue

I have a hibernate project, which uses JPA. my persistence.xml contents is as follows:
Vivek
  • 1,451
  • 8
  • 42
  • 74
0
votes
1 answer

Hibernate META-INF Location wrong?

For some weird reason my Hibernate can't find my persistence.xml in the META-INF folder. I have following project structure: src eu.bsmusin.pupil.project.db.DataBase.java META-INF/persistence.xml My class DataBase.java calls the method …
Basti
  • 1,117
  • 12
  • 32
0
votes
1 answer

Autodetection of JPA entities from JBoss module

I have an EJB module M, contained in an EAR module. M has a dependency on a jar file data-model.jar, installed as a JBoss module and correctly loaded using the jboss-deployment-structure.xml file. The module works without any problems, but I cannot…
Linuslabo
  • 1,568
  • 2
  • 24
  • 34
0
votes
1 answer

Non-referred persistenceunit init throwing DuplicateServiceException: __FIRST_PHASE__ is already registered?

I am deploying multiple war's and ear's in my Wildfly 8.1. Recently I migrated some code from hibernate to jpa in one of the jar's which is shared between a ear and a war.So this is how it goes yy.ear -> persistence.xml(ds2,ds3,ds4) -> myjpa.jar …
eminemence
  • 721
  • 1
  • 6
  • 21
0
votes
2 answers

@PersistenceUnit EntityManagerFactory not getting initialized / still null

I have a web application that I'm attempting to run inside the JBOSS EAP 6 App Server. I am attempting to Inject an EntityManagerFactory into my Singleton Bean. @Singleton @Startup public class RestServerConfigurator { private static…
daniel9x
  • 755
  • 2
  • 11
  • 28
0
votes
1 answer

How to get all rows starting from given id , and limited by a given limit using javax.persistence?

When I have 20 rows (id = 5.......id=25) I want to get 3 first rows starting from id=4 (meaning row 5, row 6 and row 7) I thought that I can use : String queryStr = "FROM MyQueue x"; Query q = DbHandler.createQuery(queryStr); …
user1386966
  • 3,302
  • 13
  • 43
  • 72
0
votes
1 answer

Connecting to mssql via persistence without copying dll

I have made a connection to a mssql using persistence.xml in java. For doing that i had to copy sqljdbc_auth.dll in to system32 because i wanted to use the windows authentication in order to connect. Is there a way to achieve the same result without…
Iman
  • 769
  • 1
  • 13
  • 51
0
votes
1 answer

Class autodetection in persistence.xml from src/test

I have a persistence.xml at src/main/resources/META-INF/ and another at src/test/... which differ only in the value of the database:
Ian
  • 1,507
  • 3
  • 21
  • 36
0
votes
1 answer

Integrate BoneCP and EclipseLink with LOCAL_RESOURCE transaction-type

I am setting up a minimal working example where I use EclipseLink in a Java EE (JSF) project. My example works perfectly with the following configuration and code: persistence.xml
0
votes
1 answer

Wildfly9: How to set a default value for a given hibernate property using JBoss/Wildfly Notation

this is my problem... I came from JBoss5 where I could set the values of the hibernate properties (hibernate.show_sql, hibernate.format_sql, hibernate.use_sql_comments, ...) at a given persistence.xml, using JBoss Property Syntax and configuring…
Carlitos Way
  • 3,279
  • 20
  • 30
0
votes
0 answers

persistence.xml --> 1 PU has multiple jdbc connections

hy guys, i use eclipselink. in past i had always ONE domainname per PU for my url-tag, like this pu:
mr-blubb
  • 11
  • 6
0
votes
1 answer

Adding new class to persistence.xml throws java.lang.IllegalArgumentException: Object: Restaurants{id=null, name=Subway} is not a known entity type

I created a new entity class, and added it to the persistence.xml file. xxx.xxx.xxx.xxx.xxx.Restaurants When trying to build in Maven, I get this error: Caused by: java.lang.IllegalArgumentException: Object: Restaurants{id=null,…
CJR
  • 3,174
  • 6
  • 34
  • 78
0
votes
2 answers

EntityManager not injected into Jboss Module

I'm working with jboss wildfly 9. I have a provider deployed as module into the : wildfly > modules > com > mycompany > myprovider folder. Then i have a jpa project with DAO pattern writing and reading inside my database. I want to handle the DAO…
Alex
  • 1,515
  • 2
  • 22
  • 44
0
votes
0 answers

[IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: DecisionTree is not mapped [SELECT n FROM DecisionTree n]]

I'm using hibernate with Play! Framework. Here's my entity: import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import…
Saksham Gupta
  • 223
  • 1
  • 2
  • 8
0
votes
1 answer

Overloading the provider in persistence.xml results in ClassNotFoundException

I'm attempting to use a custom provider in persistence.xml (actually, just creating a thin facade in front of the Hibernate Provider in order to capture audit data). I've changed the persistence.xml to look like (based on a similar stackoverflow…
Shawn Eion Smith
  • 417
  • 4
  • 18