Hibernate3.jar 的應用,被部署到weblogic10.3上後,拋出異常 org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from hbm.pojo.Area where code=:code]
解決方法:
1、在hibernate.cfg.xml上,加上一個屬性hibernate.query.factory_class,值為 org.hibernate.hql.classic.ClassicQueryTranslatorFactory,
具體代碼如下:
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
2、問題原因:weblogic.jar中已經有瞭一個antlr.jar的版本,導致應用中hibernate3.jar中用到的antlr.jar不能找到,導致該異常發生
作者:chen978616649