• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with Criteria and NamedQuery

 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I am using Netbeans with Hibernate. When I do a basic CRUD I do not have any error messages.

But when I want do a findAll (by Criteria or namedQuerie) I got an strange error message.

Can someone help me?

Bellow, the errors:

getEntityManager().createNamedQuery(namedQuery, obj) = >Exception occurred in target VM: org.hibernate.ejb.EntityManagerImpl.createNamedQuery(Ljava/lang/String;Ljava/lang/Class;)Ljavax/persistence/TypedQuery;<

getEntityManager().getCriteriaBuilder() = >Exception occurred in target VM: org.hibernate.ejb.EntityManagerImpl.getCriteriaBuilder()Ljavax/persistence/criteria/CriteriaBuilder;<



ps.: The stacktrace do not tell me anything more then above. =/
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hebert Coelho wrote:Hello.

I am using Netbeans with Hibernate. When I do a basic CRUD I do not have any error messages.

But when I want do a findAll (by Criteria or namedQuerie) I got an strange error message.

Can someone help me?

Bellow, the errors:

getEntityManager().createNamedQuery(namedQuery, obj) = >Exception occurred in target VM: org.hibernate.ejb.EntityManagerImpl.createNamedQuery(Ljava/lang/String;Ljava/lang/Class;)Ljavax/persistence/TypedQuery;<

getEntityManager().getCriteriaBuilder() = >Exception occurred in target VM: org.hibernate.ejb.EntityManagerImpl.getCriteriaBuilder()Ljavax/persistence/criteria/CriteriaBuilder;<



ps.: The stacktrace do not tell me anything more than the message above. =/

 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


ps.: The stacktrace do not tell me anything more then above. =/


They should at the very least tell you which exception is being thrown and where from. Chan you post the stack trace?
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. The stack trace did not have any message more than that one. Thats why I could not find any solution searching in the internet.

BUT

I just found the solution.

I am using netbeans 6.9.1 but it was offering me a really old hibernate version.

I removed the hibernate libraries that the netbeans was offering me and added hibernate that I just downloaded.

It worked!

Thanks for your time.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The stack trace did not have any message more than that one. Thats why I could not find any solution searching in the internet.


Something is restricting your exception logging. What you say is not how stack traces work.
 
reply
    Bookmark Topic Watch Topic
  • New Topic