在weblogic8.1中使用hibernate3的问题

在weblogic8.1中使用hibernate3的问题

在weblogic8.1中使用hibernate3,访问数据库之后weblogic就会自动关掉,并且提示如下的错误:
CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
原因分析:
在hibernate3中需要用到antlr.jar,然而这个包在weblogic.jar中已经包含了antrl类库,就会产生一些类加载的错误,无法找到在war或者ear中的hibernate3.jar。出现这个错误之后,antlr会调用System.exit(),这样weblogic就会中止服务。
解决方法:
在hibernate.properties文件中增加属性:hibernate.query.factory_class,属性的值是org.hibernate.hql.classic.ClassicQueryTranslatorFactory,这样就可以解决问题了。

你可能感兴趣的:(在weblogic8.1中使用hibernate3的问题)