使用subclass配置hibernate的时候,使用父类的service操作数据库时会报如下的错误,其原因是缺少一个jar包,引入antlr-2.7.6rc1.jar就没有问题了。
1java.lang.NoClassDefFoundError: antlr/ANTLRException
2 at org.hibernate.hql.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:35)
3 at org.hibernate.engine.query.HQLQueryPlan.<</span>init>(HQLQueryPlan.java:72)
4 at org.hibernate.engine.query.HQLQueryPlan.<</span>init>(HQLQueryPlan.java:54)
5 at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
6 at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
7 at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
8 at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583)
9 at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
10 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)