I'm getting the above error in a JBoss 5 container w/ a 1.5 jboss-j2ee.jar trying numerous Hibernate versions (this one w/ 4.1.3 as you can see from the classpath debug stmt) on this line of code
Code:
@PersistenceContext
private EntityManager em;
..
TypedQuery<ReportRequest> query = em.createNamedQuery(GET_REPORTS_BY_USER, ReportRequest.class);
Out of paranoia about Hibernate versions, I added a debug statement to print out the classpath to the EntityManagerImpl class which verifies it's using the 4.1.3 impl.
Code:
logger.debug(loader.getResource("org/hibernate/ejb/EntityManagerImpl.class"));
=>
16:06:29,188 DEBUG [ReportRequestDao] vfszip:/Users/donmit/craft/environment/jboss-5.1.0.GA/server/lycea/deploy/deploy.last/scholastic.dashboard-jboss-craft_spring3.0.ear/hibernate-entitymanager-4.1.3.Final.jar/org/hibernate/ejb/EntityManagerImpl.class
16:06:29,195 DEBUG [OpenEntityManagerInViewFilter] Closing JPA EntityManager in OpenEntityManagerInViewFilter
16:06:29,196 DEBUG [EntityManagerFactoryUtils] Closing JPA EntityManager
16:06:29,196 ERROR [ScholasticMetaFilter] Handler processing failed; nested exception is java.lang.AbstractMethodError: org.hibernate.ejb.EntityManagerImpl.createNamedQuery(Ljava/lang/String;Ljava/lang/Class;)Ljavax/persistence/TypedQuery;
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.AbstractMethodError: org.hibernate.ejb.EntityManagerImpl.createNamedQuery(Ljava/lang/String;Ljava/lang/Class;)Ljavax/persistence/TypedQuery;
I don't understand how the error can occur and am at a loss what to do next. If the answer requires someone looking at my code or environment, I may be able to get funds. Hopefully we're moving to JBoss 7 in a month, but just in case, and in the interim, I need help.
I should mention that I can't get any Entity related Hibernate/JPA2 queries to work. NativeQuery works, but nothing using Entities. Here's another posting w/ more info if it helps:
http://stackoverflow.com/questions/10642868/persistence-unit-not-finding-managed-entity