I’ve just started working on a new grails application, and early in the piece I hit this error:
2008-03-05 18:39:20.715::WARN: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@1fcb845{/jtchat,/home/prule/workspace/jtchat/web-app}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib’: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘grailsUrlMappingsHolder’: Cannot resolve reference to bean ‘urlMappingsTargetSource’ while setting bean property ‘targetSource’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘urlMappingsTargetSource’: Cannot resolve reference to bean ‘grailsUrlMappingsHolderBean’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘grailsUrlMappingsHolderBean’: Invocation of init method failed; nested exception is java.lang.RuntimeException: mappings closure does not exists for class UrlMappings
I’d not done much except for adding a domain class, controller, view and a test. Certainly I hadn’t done anything with UrlMappings. I did have a failure installing a plugin (the converter plugin which apparently is not needed anymore?), and I am editing the project in Eclipse with the Groovy plugin.
I’ve no idea what caused it, but doing a ‘grails clean‘ resolved it.






{ 3 comments… read them below or add one }
wow super was struggling with this for quite a while and even tried to do a manual clean. grails clean worked like a charm, you saved me from recreating the database and over an hour of importing all the data, thanks a ton!
Thanks for the solution, it works for me. I had the same problem.
The problem is very strange. My project1 had the problem. I made project2 and copied all important files from project1 to project2, and then project2 did not have this problem.
I used file/dir compare tools, and all files were the same, except from trivial IDE specific files (which have hardcoded project names).
Then I copied project1 (which had the error) to a temp directory, deleted the original project1 (because I tested something), and copied project1 from the temp-dir back, and ran the project1 again. This time it didn’t have the error! :S
This suggests that the problem is not related to the filesystem. Maybe there was a not-terminated project1 Grails process running in the background causing this error?
Fantastic – wrestled with this for an entire afternoon
Many thanks.