0 Replies Latest reply on Jun 15, 2011 3:09 PM by Leonid Kosmylev

    JBoss 6: java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken cannot be cast to org.hibernate.hql.ast.HqlToken

    Leonid Kosmylev Newbie

      Yeah, I know, I know... But I would like to bring this one back.


       

      It looks like the general agreement about the problem is to remove Hibernate from the deployment and rely on the version provided by JBoss AS itself. (For example, see here http://community.jboss.org/message/574839)


       

      This is fine "in general" but as usual there are corner cases. One of them is a binary 3rd party dependency that relies on some older Hibernate version.

       

      Much more interesting here is the fact the exception is happening during initialization of one of the core services (EJB3 TimerService). Why the initialization of a core service uses application classes directly? I imagine some of the services must have access to application classes, but should this not be done by the service code explicitly using the application classloader?


       

      Does anybody know why the initialization code runs on the application classloader?