I am developing an ejb application that needs to include use a lot of existing code developed for jboss 4.0.5 . The existing code leverages hibernate 3.2.7 If I include hibernate-3.2.7.ga.jar in my ear, I get many errors such as:
java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken cannot be cast to antlr.Token
at antlr.CharScanner.makeToken(Unknown Source) [:6.0.0.Final]
at org.hibernate.hql.ast.HqlLexer.makeToken(HqlLexer.java:62) [:3.6.0.Final]
...
So my more general question is how can I run existing code which uses jars that conflict with container jars?
Thanks for any assistance or pointers.