Fixing a Grails plugin cache issue

I’ve been working on this small application as I continue to tinker around with Grails, and set the source code management up through GitHub so that I can synchronize across machines. My Mac laptop has 2.1.0RC2 while my PC had 2.0.4 where I planned to upgrade to 2.1.0RC2 as well.

When I thought I was good to go I began running into some really strange errors:



I then attempted to do a “grails clean”, and experiment with creating a new app and copy in the source to see if that would make a difference, but continued to encounter the issue.

However I did notice in the output that it was referencing a c:\users\{user}\.grails\{version} directory and attempted to nuke the version folder, and still had the same issue.

However, deleting the entire .grails directory fixed the issue!

Conclusion

There’s obviously caching going on here, and I’m guessing the auto-wizardry that figures out plugin dependencies got out of sync. So deleting that directory causes Grails to download fresh all the components that it needs to build the app.

Error Signature

Error executing bootstraps: Error creating bean with name ‘transactionManagerPostProcessor’: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘transactionManager’: Cannot resolve reference to bean ‘sessionFactory’ while setting bean property  ‘sessionFactory’;

Written by Tariq Ahmed