File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sam White
Ranch Hand
Posts: 229
  • 0
  • 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.
Thanks
Sam
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic