Ao tentar executar a classe TesteCriaTabelas está retornando o erro abaixo, mas conferi várias vezes o código e não consigo entender o porque do erro
Mensagem de Erro:
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named contas at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at br.com.alura.jpa.testes.TesteCriaTabelas.main(TesteCriaTabelas.java:9)
Código classe TesteCriaTabelas:
package br.com.alura.jpa.testes;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class TesteCriaTabelas {
public static void main(String[] args) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("contas");
EntityManager createEntityManager = emf.createEntityManager();
emf.close();
}
}
Conteúdo do arquivo persistence.xml
package br.com.alura.jpa.testes;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class TesteCriaTabelas {
public static void main(String[] args) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("contas");
EntityManager createEntityManager = emf.createEntityManager();
emf.close();
}
}