ANTlr – The Mountain problem

Recently, I was trying to integrate Struts with Hibernate 3.2 under Weblogic. And i had this big pestering exception…

javax.servlet.ServletException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.g2h.biz.vo.Category category]
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:909)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:873)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:812)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3281)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3226)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3207)
at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java:694)
at weblogic.servlet.internal.WebService.preloadResources(WebService.java:483)
at weblogic.servlet.internal.ServletInitService.resume(ServletInitService.java:30)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)

The reason for this problem is this. Both Weblogic and Hibernate was using “antrl.jar”. Weblogic 8.1, that i was using, had an “antlr” jar bundled inside its weblogic.jar. Since server libraries had preference over the jars in our application, hibernate wasnt using the latest antlr jar in my web application’s lib folder.

Solution that i used :

Put the following lines in your “.cfg.xml” inside your session-factory tag

classicquery
There is a biggggg discussion in the hibernate forum on this issue. It also had another solution for weblogic. To add the following tag inside weblogic.xml

weblogic.xml

1 Response to “ANTlr – The Mountain problem”


  1. 1 Sandip May 9, 2007 at 4:13 pm

    using causes other class cast exceptions.


Leave a Reply




 

February 2007
M T W T F S S
     
 1234
567891011
12131415161718
19202122232425
262728  

Top Clicks

  • None

Archives

a