Boa tarde pessoal, eu estou tentando fazer um exemplo sobre JPA só que deu esse erro abaixo:
Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/proxy/EntityNotFoundDelegate
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:119)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at hello.HelloWorld.main(HelloWorld.java:16)
meu persistence.xml que está em etc/META-INF está assim:
<persistence version="1.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://www.w3.org/2001/XMLSchema-instance ">
<persistence-unit name="HelloWorld">
<properties>
<property name="hibernate.ejb.cfgfile" value="/hibernate.cfg.xml"/>
</properties>
</persistence-unit>
</persistence>
Este aqui é o meu main básico:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("HelloWorld");
EntityManager em = emf.createEntityManager();
EntityTransaction tx = em.getTransaction();
tx.begin();
Message message = new Message("Hello Worlddd");
em.persist(message);
tx.commit();
em.close();
emf.close();
alguém tem alguma idéia do que possa ser?!!!
grato pela ajuda!!