1

I am trying the example code for using hibernate in Groovy here:

Using Hibernate with Groovy

It works fine when I run it via groovy, but when I run it with groovyConsole I am getting a classloader issue:

org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

A little googling suggest to me that the issue is Hibernate and ANTLR coming from different classloaders, but if that is the case, it isn't clear to me how I might work around the issue and still use grape for dependencies. (I have several developers who are very productive with the console, and I would really like to avoid retooling.)

M. Justin
  • 14,487
  • 7
  • 91
  • 130
  • Does using `@GrabConfig(systemClassLoader=true)` help? – tim_yates May 09 '13 at 12:47
  • When I add that I get `java.lang.ClassCastException: org.hibernate.dialect.HSQLDialect cannot be cast to org.hibernate.dialect.Dialect` which seems even weirder to me. Still works fine when run via groovy. – hymenopterans May 09 '13 at 16:31
  • One thing I just noticed is this comment that I had overlooked `// javax.transaction jta.jar added manually to ivy repo` I am running a completely vanilla grapes config. – hymenopterans May 09 '13 at 17:04

0 Answers0