在weblogic下使用hibernate+spring需要在hibernate-context.xml中定义下面属性,
<prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
否则会出现以下异常:
Exception in thread "Timer-5" org.springframework.orm.hibernate3.HibernateQueryE
xception: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.futur
esoftware.oa.workflow.engine.ActivityInstance t where t.timeoutTime<to_date('200
7-9-27 18:03:29','yyyy-MM-dd hh24:mi:ss') and t.status!=4 and t.isTimeout=0]; ne
sted exception is org.hibernate.QueryException: ClassNotFoundException: org.hibe
rnate.hql.ast.HqlToken [from com.futuresoftware.oa.workflow.engine.ActivityInsta
nce t where t.timeoutTime<to_date('2007-9-27 18:03:29','yyyy-MM-dd hh24:mi:ss')
and t.status!=4 and t.isTimeout=0]
Caused by: org.hibernate.QueryException: ClassNotFoundException: org.hibernate.h
ql.ast.HqlToken [from com.futuresoftware.oa.workflow.engine.ActivityInstance t w
here t.timeoutTime<to_date('2007-9-27 18:03:29','yyyy-MM-dd hh24:mi:ss') and t.s
tatus!=4 and t.isTimeout=0]
at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57)
at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31)
at antlr.CharScanner.<init>(CharScanner.java:51)
at antlr.CharScanner.<init>(CharScanner.java:60)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:56)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:53)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:50)
at org.hibernate.hql.ast.HqlLexer.<init>(HqlLexer.java:26)
at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:44)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.j