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 and, 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.

Related Posts

Popular Posts