instalei o Wildfly 10, que ja vem com as bibliotecas nativas, quando inicio o servidor tudo roda perfeitamente, porem ao testa-lo com o arquivo main, recebo a menssagem: "No Persistence provider for EntityManager named ..." - O persistence.xlm esta no lugar certo. podem me majudar?
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
org.hibernate.jpa.HibernatePersistenceProvider
br.com.wolf.modelo.Conta
Conta.java
package br.com.wolf.modelo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
@Entity
@SequenceGenerator(name = "SEQ_Conta", sequenceName = "SEQ_Conta", initialValue = 1)
public class Conta {
@Id
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_Conta")
private Integer idConta;
private String emailConta;
private String senhaConta;
public Integer getIdConta() {
return idConta;
}
public String getEmailConta() {
return emailConta;
}
public void setEmailConta(String emailConta) {
this.emailConta = emailConta;
}
public String getSenhaConta() {
return senhaConta;
}
public void setSenhaConta(String senhaConta) {
this.senhaConta = senhaConta;
}
}
TesteJPA.java
package br.com.wolf.run;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import br.com.wolf.modelo.Conta;
public class TesteJPA {
public static void main(String[] args) {
double inicio = System.currentTimeMillis();
EntityManagerFactory emf = Persistence.createEntityManagerFactory("wolfportal");
EntityManager em = emf.createEntityManager();
Conta conta = new Conta();
conta.setEmailConta("teste");
conta.setSenhaConta("123");
em.getTransaction().begin();
em.persist(conta);
em.getTransaction().commit();
em.close();
double fim = System.currentTimeMillis();
System.out.println("Executado em: " + (fim - inicio) / 1000 + "s");
}
}
==================
Erro
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named wolfportal
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:61)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
at br.com.wolf.run.TesteJPA.main(TesteJPA.java:18)