Using Spring Hibernate Template classes/API within ServiceMix 4.x causes ClassCastException or ClassNotFoundException

Solution Verified - Updated -

Environment

  • Fuse ESB 4.x

Issue

java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken cannot be cast to antlr.Token
ClassNotFoundException: org.hibernate.hql.ast.HqlToken

Resolution

A possible solution is to add

DynamicImport-Package:*

to the Manifest of the Springsource antlr bundle.

Root Cause

This is a known issue with Springsource antlr bundle: https://issuetracker.springsource.com/browse/EBR-303

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments