• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Unable to locate HQL query plan in cache; generating (from Event)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I am a newbee in Hibernate. I got an error "unable to locate HQL query plan in cache; generating (from Event)" when using the query "from event". Please find the code fragment below.


I have a java bean Event in event package. I am able to store the events in mysql database. Am I missing something?
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you include "antlr-2.7.6.jar" in your project it should work just fine.

I had the same problems, but fixed it with including the "antlr-2.7.6.jar" into my project.

I am using Hibernate 3.2, and in the Hibernate installation lib directory there are several *.jar files. First I included "ant-antlr-1.6.5.jar", and I got the same error as you.

BUT, the error you get is a side effect from it not finding the class definition. So the problem is NOT "unable to locate HQL query plan in..."

Look at all the errors you get:

09:07:02,011 DEBUG QueryPlanCache:70 - unable to locate HQL query plan in cache; generating (from Event)
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
.
.
.
Caused by: java.lang.reflect.InvocationTargetException
.
.
.
Caused by: java.lang.NoClassDefFoundError: antlr/ANTLRException
[ December 12, 2006: Message edited by: Henrik Engert ]
 
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
Another point: why are you wrapping your query in a transaction?
 
Henrik Engert
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The example he is showing is from the tutorial from the Hibernate website. It's a copy&paste, but that's just my guess.

+ you get this if you don't wrap it:

Exception in thread "main" org.hibernate.HibernateException: createQuery is not valid without active transaction
[ December 12, 2006: Message edited by: Henrik Engert ]
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to @ll, Sudheer, have You set your mapping resource through hibernate.cfg.xml or are you setting this in your code?

Thanks
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henrik Engert wrote:If you include "antlr-2.7.6.jar" in your project it should work just fine.

I had the same problems, but fixed it with including the "antlr-2.7.6.jar" into my project.

I am using Hibernate 3.2, and in the Hibernate installation lib directory there are several *.jar files. First I included "ant-antlr-1.6.5.jar", and I got the same error as you.

BUT, the error you get is a side effect from it not finding the class definition. So the problem is NOT "unable to locate HQL query plan in..."

Look at all the errors you get:

09:07:02,011 DEBUG QueryPlanCache:70 - unable to locate HQL query plan in cache; generating (from Event)
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
.
.
.
Caused by: java.lang.reflect.InvocationTargetException
.
.
.
Caused by: java.lang.NoClassDefFoundError: antlr/ANTLRException
[ December 12, 2006: Message edited by: Henrik Engert ]



thank you . it is.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic