Wednesday, October 24, 2007

BEA Weblogic 8.1 and Hibernate 3.x new SQL Parser

Hibernate 3.x uses new sql parser for HQL by default that requires antlr.jar. BEA also uses the same parser for EJB-QL. The problem is that because WL loads the its own version of the jar file before your application, and therefore a different and older version of jar is loaded.

Your application encounters "org.hibernate.QueryException: ClassNotFoundException" for “org.hibernate.hql.ast.HqlToken” even though you include the antlr.jar file from hibernate distribution.

This issue is addressed in the hibernate document site at:
http://www.hibernate.org/250.html

The easy way this can be resolved is by modifying the startWeblogic script and include your own jar file in the beginning of the classpath so yours gets loaded before the BEA’s jar file.

3 comments:

Anonymous said...

uh.. interesting text :))

Anonymous said...

Your blog keeps getting better and better! Your older articles are not as good as newer ones you have a lot more creativity and originality now keep it up!

charleston forge furniture said...

Being new, I am always looking around online for articles to help.