With the release of Grails 1.3.1 we decided that it was finally time to stop our ‘copy all the jars to lib’ process and use the awesome dependency manager.
As with any move from static lib directory to a smarter dependency manager we ran into some puzzling issues. One engineer set it all up and it worked great on our build system, but then about 50% of our engineers ran into some strange issues including this one which prevented any grails scripts from running:
... SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also http://www.slf4j.org/codes.html#log4j_version SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/Users/john_doe/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/john_doe/.ivy2/cache/org.slf4j/nlog4j/jars/nlog4j-1.2.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. ...
Hacking around randomly seemed to fix it in every case. Here’s the crude process we ended up following to resolve these strange issues:
- Purge the local caches by deleting
~/.ivyand~/.grails - Reboot (Yes this fixed the problem for someone… go figure)
- Run
grails upgradeover and over until it started working
What is the root cause? I have no idea. Perhaps our dependency on the public repositories is to blame: one should never trust a free third party service.
