• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Criteria and NamedQuery

 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
  • 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. =/
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic