Alone as an Island What’s the pride in being a Programmer?
Feb 03

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

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • description
  • Furl
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis

Tags: ,

No Responses to “ANTlr - Weblogic and Hibernate problem”

  1. Stasigr Says:

    Hello, very nice site, keep up good job!
    Admin good, very good.

Leave a Reply

Give your best to the world.