No Persistence provider for EntityManager named - I am doing something wrong? - java

I have my persistence.xml with the same name, using toplink, under META-INF directory. Then I have my code calling it with...
public class DBConnect {
#PersistenceUnit
EntityManagerFactory emf;
public DBConnect()
{
emf = null;
}
public void startConnection()
{
emf = Persistence.createEntityManagerFactory
(
"cvut.fel.pjv.persistence.xml"
);
}
public void closeConnection()
{
emf.close();
}
public EntityManagerFactory getEMF()
{
return emf;
}
}
I have got the following error message:
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named cvut.fel.pjv.persistence.xml
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at utils.DBConnect.startConnection(DBConnect.java:30)
at utils.Server.<init>(Server.java:32)
at utils.Server.main(Server.java:58)
Here are my persistence.xml - I think it should be right
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="cvut.fel.pjv_LibrarySystem_server_jar_1.0-SNAPSHOTPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>model.Vydani</class>
<class>model.Nosic</class>
<class>model.Vypujcka</class>
<class>model.Adresa</class>
<class>model.Casopis</class>
<class>model.Kategorie</class>
<class>model.Kniha</class>
<class>model.Nakladatelstvi</class>
<class>model.Zamestnanec</class>
<class>model.Ctenar</class>
<class>model.Vytisk</class>
<class>model.Autor</class>
<class>model.SpisovatelePocetDel</class>
<class>model.UzivateleAdresy</class>
<class>model.Osoba</class>
<class>model.DigitalniNosic</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://slon.felk.cvut.cz:5432/db18_koresmi1"/>
<property name="javax.persistence.jdbc.user" value="db18_koresmi1"/>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
<property name="javax.persistence.jdbc.password" value="Hk2JsA"/>
</properties>
</persistence-unit>
</persistence>
And there is a pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cvut.fel.pjv</groupId>
<artifactId>LibrarySystem_server</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
<version>2.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1212</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
I very much appreciate your help - I'm doing in netbeans as a maven project

The argument for Persistence.createEntityManagerFactory is the name of the persistence unit. According to your persistence.xml your persistence unit is named cvut.fel.pjv_LibrarySystem_server_jar_1.0-SNAPSHOTPU. The following code should work:
emf = Persistence.createEntityManagerFactory("cvut.fel.pjv_LibrarySystem_server_jar_1.0-SNAPSHOTPU");

Related

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 I query it with curl I get the error: "No Persistence provider for EntityManager".
What's causing the discrepancy between the local and remote (IBM Cloud) environments and what can I do to fix it?
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="ibmcloud">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<non-jta-data-source>java:comp/DefaultDataSource</non-jta-data-source>
<class>entities.Comment</class>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.use_sql_comments" value="true"/>
</properties>
</persistence-unit>
</persistence>
.travis.yml
language: java
jdk: oraclejdk8
sudo: false
before_install:
mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
before_deply:
cf login -u $BLUEMIX_USER -o $BLUEMIX_ORG
script:
mvn test -B
language: java
git:
depth: 1
dist: trusty
cache:
directories:
- "$HOME/.m2"
deploy:
edge: true
provider: bluemixcloudfoundry
username: $BLUEMIX_USER
password: $BLUEMIX_PASSWORD
organization: $BLUEMIX_ORG
space: $BLUEMIX_SPACE
manifest: manifest.yml
app_name: ibmcloudapp
region: eu-gb
api: https://api.eu-gb.bluemix.net
skip_cleanup: true
manifest.yml
applications:
- name: ibmcloud
path: target/ibmcloud.war
instances: 1
random-route: true
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dotheminimum</groupId>
<artifactId>ibmcloud</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate.javax.persistence/hibernate-jpa-2.1-api -->
<!-- <dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.2.Final</version>
</dependency> -->
<!-- https://mvnrepository.com/artifact/javax.persistence/javax.persistence-api -->
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
</plugins>
</build>
</project>
The source code for the app is hosted here
The problem was that my "persistence.xml" file was under "src/main/java/META-INF" instead of "src/main/resources/META-INF".
My local environment was able to find the file, but IBM Cloud didn't. After changing the path of "persistence.xml", the file was detected by IBM Cloud.
If I had been exhaustive, I would have been able to find my solution in the comments of the first result of the search linked to by Billy Frost (No Persistence provider for EntityManager named)

Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named databaseTest

I am trying to use oracle database in my java web app, but I keep getting the error when I run my code as a java application:
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named databaseTest
here is my code just a simple code to create an entity manager:
package com.sabir.test;
import javax.persistence.Persistence;
public class DatabaseService {
public static void main(String[] args) {
System.out.println("test");
Persistence.createEntityManagerFactory("databaseTest");
}
}
and here is my persistence.xml file
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_1_0.xsd" version="1.0">
<persistence-unit name= "databaseTest" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:#localhost:1521:orcl"/>
<property name="javax.persistence.jdbc.user" value="HR"/>
<property name="javax.persistence.jdbc.password" value="password"/>
</properties>
</persistence-unit>
</persistence>
and if required here is my pom.xml file :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sabir.test</groupId>
<artifactId>databaseTest</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>databaseTest Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.0-RC1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
<repository>
<id>oss.sonatype.org</id>
<name>OSS Sonatype Staging</name>
<url>https://oss.sonatype.org/content/groups/staging</url>
</repository>
<repository>
<id>EclipseLink</id>
<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
</repository>
</repositories>
<build>
<finalName>databaseTest</finalName>
</build>
</project>
I don't know why I am getting the error! here is also my files structure :
I am suspecting the file structure but after I checked many websites, I believe this is the correct one. I also imported the eclipslink in maven so I believe that is all I need, I also added the repository or oracle.
my database is also up and running and I can query from the oracle developer tool
First of all check if you have Maven Libraries on the build path.
In Eclipse you would go to
Project Properties -> Java Build Path -> Libraries.
If you do, check below:
You don't have provider you are referring to on your classpath.
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
I suggest to add the following to your dependencies(and remove eclipselink dependency):
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
or change eclipselink dependency to
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>2.6.4</version>
</dependency>
How and where do you obtain EntityManager from EntityManagerFactory?
I see only that you are creating instance of EntityManagerFactory only.
It should be
EntityManagerFactory emf = Persistence.createEntityManagerFactory("databaseTest");
EntityManager em = emf.createEntityManager();
In general this approach is useful only if you want to bootstrap in Java SE environment.
Instead you might use dependency injection:
#PersistenceContext
EntityManager em;
or
#PersistenceUnit(unitName="myUnit")
EntityMangerFactory emf;
then in your methods you can get EntityManager again as follows
EntityManager em = emf.createEntityManager();
Or you can use JNDI lookup.

Hibernate 5.2.2: No Persistence provider for EntityManager

What has changed between Hibernate 5.1.1 and 5.2.2? If I use 5.2.2 I'll get an error message "No Persistence provider for EntityManager named pu". Exactly the same configuration works with 5.1.1. How should I change my code to get 5.2.2 to work?
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jpatest</groupId>
<artifactId>jpatest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<hibernate.version>5.2.2.Final</hibernate.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1209.jre7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
</dependencies>
</project>
persistence.xml in src/main/resources/META-INF
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="pu" >
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.archive.autodetection" value="class" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/mydb" />
<property name="hibernate.default_schema" value="myschema" />
<property name="hibernate.connection.username" value="xxx" />
<property name="hibernate.connection.password" value="zzz" />
<!-- <property name="hibernate.show_sql" value="true"/> -->
<property name="hibernate.flushMode" value="FLUSH_AUTO" />
<property name="hibernate.hbm2ddl.auto" value="validate" />
</properties>
</persistence-unit>
</persistence>
creating EntityManager
factory = Persistence.createEntityManagerFactory("pu");
em = factory.createEntityManager();
tx = em.getTransaction();
The class org.hibernate.ejb.HibernatePersistence does not exist in the hibernate-release-5.2.2.Final.zip bundle file. That's why the provider can't be found, because the class can't (at the project library jars). Instead, I used the class org.hibernate.jpa.HibernatePersistenceProvider, which CAN be found at hibernate-core-5.2.2.Final.jar (that comes with hibernate-release-5.2.2.Final.zip bundle), by changing the provider at persistence.xml to <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>. Doing so, it worked fine! Hope the problem is only this.
I had the same error.
I changed version of
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
from 5.3.1.Final to 5.3.6.Final and error disappeared.
Sometimes simply forgetting to add the persistence.xml file to build path causes this problem. Follow the following steps:
Right click on persistence.xml file.
Click on Build Path
Add to build path
Then it should work.

Eclipselink Maven No Persistence provider for EntityManager named

I try to create a JPA Project with Maven in Intellij.
I use Eclipse Link and the Database is SQlite.
This is my current pom.xml File (only the Dependencies):
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.8.11.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.6.3</version>
</dependency>
My persistence.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" version="2.1">
<persistence-unit name="NewPersistenceUnit">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.raeste.db.BuchungEntity</class>
<class>com.raeste.db.KategorieEntity</class>
<properties>
<property name="eclipselink.jdbc.url" value="jdbc:sqlite:/home/raeste/programmierung/haushaltsbuch.db"/>
<property name="eclipselink.jdbc.driver" value="org.sqlite.JDBC"/>
</properties>
</persistence-unit>
</persistence>
If i now try to create an EntityMangerFactory I get the following exception:
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named NewPersistenceUnit
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
The Code to create the EntityManagerFactory is:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("NewPersistenceUnit");
I know there are several questions with that problem but non of them helped.
The persistence.xml file is under the following path:
src/main/java/META-INF/
The persistence.xml file should be at src/main/resources/META-INF.
src/main/java is for Java source code.
src/main/resources is for resource files.
Try it.

switching from Hibernate to JPA Interface that implements Hibernate

I'm not exactly sure how to phrase my question, but I have been working through a hibernate tutorial and everything has been smooth sailing until we switched from using the hibernate.cfg.xml to a resources/META-INF/persistance.xml. It seems that the program cannot create an EntityManagerFactory object, and is throwing an XsdException. After trying to research what that exception is, im not exactly sure what it means, or how to fix it. at this point just starting a session and closing the transaction would be a big step. what am i doing wrong? am i not putting the persistance.xml file in the right spot? any directional advice would be greatly appreciated...
Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/internal/util/xml/XsdException
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:80)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:71)
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:52)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
at ApplicationJPA.main(ApplicationJPA.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.ClassNotFoundException: org.hibernate.internal.util.xml.XsdException
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
src/main/java/applicationJPA.java (driver)
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
public class ApplicationJPA {
public static void main(String[] args) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("infinite-finances");
EntityManager em = emf.createEntityManager();
EntityTransaction tx = em.getTransaction();
tx.begin();
em.close();
emf.close();
}
}
src/main/recourses/META-INF/persistance.xml
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" version="2.1">
<persistence-unit name="infinite-finances" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="javax.persistence.jdbc.user" value="user"/>
<property name="javax.persistence.jdbc.password" value="passwprd"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/infinite_skills"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<!-- Create/update tables automatically using mapping metadata -->
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.show_sql" value="true"/>
</properties>
</persistence-unit>
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.infiniteSkills</groupId>
<artifactId>ifinance-hibernateTut</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.6.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.0.0.CR2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.36</version>
</dependency>
</dependencies>
</project>
Not sure but could be the hibernate-entitymanager dependency, switch to this one:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.6.Final</version>
</dependency>

Categories

Resources