This is caused by missing of the antlr library. It’s usually happened when you did invoke Hibernate’s query statement.

Exception in thread "main" java.lang.NoClassDefFoundError: antlr/ANTLRException
	at org.hibernate.hql.ast.ASTQueryTranslatorFactory.createQueryTranslator(
	at org.hibernate.engine.query.HQLQueryPlan.<init>(
	at org.hibernate.engine.query.HQLQueryPlan.<init>(
	at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(
	at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(
	at org.hibernate.impl.AbstractSessionImpl.createQuery(
	at org.hibernate.impl.SessionImpl.createQuery(
	at com.mkyong.common.App.main(
Caused by: java.lang.ClassNotFoundException: antlr.ANTLRException
	at Method)
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	at java.lang.ClassLoader.loadClassInternal(
	... 8 more


You can download the library from Antlr official website


Add the dependency in Maven’s pom.xml

Tags :
Founder of, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.
My website is hosted by Liquid Web, I really like their fast and helpful support, it saved me a lot of time. Furthermore, their servers are extremely reliable, fast and stable, I don't remember when was the last time we had server downtime. Btw, they're offering $100 Coupon now, if you are sourcing for great hosting provider, go grab it.

Related Posts

Popular Posts