`

Weblogic10.3 org.hibernate.hql.ast.hqltoken 异常解决

 
阅读更多

这是因为在Hibernate3.0 采用新的基于ANTLR的HQL/SQL查询翻译器,需要用到antlr,然而这个包在weblogic.jar中已经包含了较早版本的antrl 包,不 能兼容,就会产生一些类加载的错误,出现ClassNotFoundException: org.hibernate.hql.ast.HqlToken的异常。

在Hibernate的配置文件中,hibernate.query.factory_class属性用来选择查询翻译器,有如下几种方式:

  1. 选择Hibernate3.0的查询翻译器:
    hibernate.query.factory_class= org.hibernate.hql.ast.ASTQueryTranslatorFactory
  2. 选择Hibernate2.1的查询翻译器
    hibernate.query.factory_class= org.hibernate.hql.classic.ClassicQueryTranslatorFactory

为了使用3.0的批量更新和删除功能,只能选择(1)否则不能解释批量更新的语句。

留意一下: %wls_home% /modules/下有 com.bea.core.antlr_2.7.7.jar 和自己加入的jar包中有一样的包 即发现问题所在

更多:

http://xqfy1983.blog.sohu.com/61054398.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics