Searchable Plugin Unable to Resolve Class in Grails 2.2.4

grails, grails-searchable, searchable

Solution

Believe you need to run `grails refresh-dependencies` after the plugin is added in `BuildConfig.groovy` but before `run-app`.

This would help in refreshing the dependencies of the app to those two files which are present in `lib` of the plugin.

`searchable-0.6.4/lib/compass-2.2.1.jar`.

As those dependencies are not configured in dependency section in the `BuildConfig` of the plugin but in `lib`, hence `refresh-dependencies` command is required.

It works in subsequent attempts because once the app is compiled or run, app becomes cognizant of the transitive dependencies it needs to pull from the plugin.

Problem

Whenever I run my Grails application for the first time, using searchable 0.6.4, I get the following error: ``` | Error Fatal error during compilation org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 25: unable to resolve class org.compass.gps.device.hibernate.HibernateGpsDevice @ line 25, column 1. import org.compass.gps.device.hibernate.HibernateGpsDevice ^ C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 26: unable to resolve class org.compass.gps.impl.SingleCompassGps @ line 26, column 1. import org.compass.gps.impl.SingleCompassGps ^ 2 errors (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 25: unable to resolve class org.compass.gps.device.hibernate.HibernateGpsDevice @ line 25, column 1. import org.compass.gps.device.hibernate.HibernateGpsDevice ^ C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 26: unable to resolve class org.compass.gps.impl.SingleCompassGps @ line 26, column 1. import org.compass.gps.impl.SingleCompassGps ^ 2 errors at RunApp$_run_closure3_closure8_closure9.doCall(RunApp:62) at RunApp$_run_closure3_closure8_closure9.doCall(RunApp) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at RunApp.withCompilationErrorHandling(RunApp:69) at RunApp.this$4$withCompilationErrorHandling(RunApp) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:168) at RunApp$_run_closure3_closure8.doCall(RunApp:61) at RunApp$_run_closure3_closure8.doCall(RunApp) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at RunApp$_run_closure3.doCall(RunApp:58) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81) at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128) at RunApp$_run_closure2.doCall(RunApp:45) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:168) at RunApp$_run_closure2_closure9.doCall(RunApp:42) at RunApp$_run_closure2_closure9.doCall(RunApp) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at RunApp$_run_closure2.doCall(RunApp:41) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81) at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128) at RunApp$_run_closure1.doCall(RunApp.groovy:30) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant.withBuildListeners(Gant.groovy:427) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:415) at gant.Gant.this$2$dispatch(Gant.groovy) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.executeTargets(Gant.groovy:591) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at gant.Gant.executeTargets(Gant.groovy:590) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1259) | Error Fatal error during compilation org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 25: unable to resolve class org.compass.gps.device.hibernate.HibernateGpsDevice @ line 25, column 1. import org.compass.gps.device.hibernate.HibernateGpsDevice ^ C:\Users\starryknight64\.grails\2.2.4\projects\myapp\plugins\searchable-0.6.4\.\SearchableGrailsPlugin.groovy: 26: unable to resolve class org.compass.gps.impl.SingleCompassGps @ line 26, column 1. import org.compass.gps.impl.SingleCompassGps ^ 2 errors ``` Attempting to run the application a second time results in the application running as expected. Not a showstopper, but certainly troublesome, any idea on how to resolve this?

Original source