• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Incorrect hibernate version or maven ignore and didn't download hibernate jar file.

Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have an EAR project, consist of EJB and WAR modules.
When I compiled my ejb module, it could not find a method "getCriteriaBuilder()". Full log is shown as below:

Here is the pom.xml file for the ejb module:

Here is the offending code:

I also found that the command "mvn clean install" under my ejb module didn't actually download hibernate jar file. Is there any problem in my pom.xml file?
And I also want to know what version of hibernate support the method "getCriteriaBuilder()".

Any suggestion is very appreciated.
Posts: 5856
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I double-checked Maven Central and the specific hibernate JAR file your POM references is there. Check your local repository, possibly deleting the ./org/hibernate/hibernate-entitymanager directory; that should force Maven to attempt to download the JAR again (at times I find that a failed download seems to prevent future downloads)

Regarding the getCriteriaBuilder() method, you are calling that on javax.persistence.EntityManager, which is not part of hibernate-entitymanager. Instead, it is part of javax.persistence:persistence-api:1.0, and javax.persistence.EntityManager does not have the getCriteriaBuilder() method
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic