Olá, pessoal.
Estou usando uma apostila de desenvolvimento java muito legal (http://assets.algaworks.com/media/ebooks/algaworks-ebook-java-ee-7-com-jsf-primefaces-e-cdi-20131224.pdf).
Mas, estou na parte de criação das tabelas no mysql através do hibernate.
Mas estou me deparando com um erro muito chato, a qual não sei resolver.
Segue abaixo o erro:
Mai 04, 2015 5:59:33 PM org.hibernate.ejb.Ejb3Configuration configure
INFO: HHH000318: Could not find any META-INF/persistence.xml file in the classpath
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named FinanceiroPU
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at com.algaworks.financeiro.main.CriaTabelas.main(CriaTabelas.java:14)][Mai 04, 2015 5:59:33 PM org.hibernate.ejb.Ejb3Configuration configure
INFO: HHH000318: Could not find any META-INF/persistence.xml file in the classpath
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named FinanceiroPU
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at com.algaworks.financeiro.main.CriaTabelas.main(CriaTabelas.java:14)
package com.algaworks.financeiro.main;
import javax.persistence.Persistence;
/**
*
* @author Julio
*
*/
public class CriaTabelas {
public static void main(String[] args) {
Persistence.createEntityManagerFactory("FinanceiroPU");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
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
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="FinanceiroPU">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/financeiro" />
<property name="javax.persistence.jdbc.user" value="usuario" />
<property name="javax.persistence.jdbc.password" value="root" />
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="update" />
</properties>
</persistence-unit>
</persistence>
Alguém pode me ajudar, por favor?
