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’;

5 Responses to “Fixing a Grails plugin cache issue”

  1. Deleting the whole .grails directory is overkill – you just need to delete the project’s folder under the .grails directory, e.g. ‘~/.grails/2.0.4/projects/appname’. If you delete the whole directory you will delete the files for other apps that are working fine.

    But there’s an easier approach. Delete these lines in BuildConfig.groovy:

    grails.project.class.dir = “target/classes”
    grails.project.test.class.dir = “target/test-classes”
    grails.project.test.reports.dir = “target/test-reports”

    and replace with

    grails.project.work.dir = ‘target’

    and then everything will be under /target – when you see weird behavior delete the target directory and run ‘grails compile’ to recompile source and re-install your plugins.

  2. Tariq Ahmed says:

    Hi Burt – thanks, that’s good advice!

  3. DavidYou may want to look at the other job trends posts, in the Job Trends cargoety. Learning scripting languages is a good idea, but moving completely away from Java may not be a good thing. Do some research on your general area or type of development to determine which language may have the best job prospects. Thanks for reading!

  4. Hi there If you desire to grow your knowledge just keep visiting this site and be updated with the latest news update posted here. thanks

  5. My programmer is trying to persuade me to mmove to .net from PHP.
    I havee always disliked the idea because of
    the costs. But he’s tryiong none the less. I’ve been using Movable-type on numerous websites for aboput a year and am
    nervous about switching to another platform. I have heard very good things
    about blogengine.net. Is therde a way I can import all mmy wordpress posys into it?

    Any help would be greatly appreciated!

Leave a Reply

Your email address will not be published. Required fields are marked *