Running "hello world" example in book "Java Persistence with Hibernate", Manning edition, (in section "Using Hibernate Entity Manager" -> "Automatic detection of metadata"), i find this exception:
Code:
Exception in thread "main" java.lang.NoSuchFieldError: NONE
at org.hibernate.ejb.QueryImpl.<init>(QueryImpl.java:604)
at org.hibernate.ejb.QueryImpl.<init>(QueryImpl.java:79)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:268)
at hello.HelloWorld.main(HelloWorld.java:34)
and the interested line of code of Hello wolrd.java is
Code:
newEm.createQuery("select m from Message m order by m.text asc").getResultList();
Why?
The code of Message class, HelloWorld.java, persistence.xml is the same of the tutorial on the book. But i don't understand why this exception.
Some help?