Grails ClassCastException com.sun.proxy.$Proxy cannot be cast to org.springframework.orm.hibernate3.HibernateCallback

When launching a Grails app, you sometimes get a java.lang.ClassCastException: com.sun.proxy.$Proxy28 cannot be cast to org.springframework.orm.hibernate3.HibernateCallback

Just clear the .slcache directory.

On windows, that’s %userdir%\.grails\.slcache
On *x, it’s something along ~/.grails/2.0.4/.slcache/

Unfortunately, that happens up to several times a week. But if you just delete the folder, it’s fixed (until next time …).
The problem seems to occur more often when switching between different Grails apps in IntelliJ Idea.

This entry was posted in Software. Bookmark the permalink.

One Response to Grails ClassCastException com.sun.proxy.$Proxy cannot be cast to org.springframework.orm.hibernate3.HibernateCallback

  1. Chris Peacock says:

    This happens when running apps built with different Grails versions. There is an environment variable, GRAILS_AGENT_CACHE_DIR, that is supposed to set the location of .slcache which could be used to avoid these conflicts, but it’s not currently working for me.

Comments are closed.