• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
Thanks
Sam
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Arthur, where are your pants? Check under this tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic