ClassNotFoundException: org.hibernate.hql.ast.HqlToken in Weblogic
September 5th, 2007
Hibernate’s migration guide mentions that WebLogic uses a different version of ANTLR causing this exception.
A work around for this problem (differnet from what Hibernate mentions) is to set the “prefer-web-inf-classes” element in weblogic.xml to true.
<weblogic-web-app>
....
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
....
</weblogic-web-app>
I encountered this problem several months ago while running under WebLogic 8.x. Interestingly, it still exists in WebLogic 10.x server.

Man this saved my bacon!!!! A lot better solution than the crap Hibernate and others offered!!!!
Thanks!!!
A simple solution for a problem that’s been plaguing me the whole day. Thank you!
I have a catch-22 situation…
I do pref-web-inf-classes=false to make my spring applicationContext work fine(otherwise linkageError with org.w3x.dom.Document
But then i get this hibernate exception when I start app and try to login(which uses a db query)
If do pref-web-inf-classes=true, like I said before spring app context won’t load up.