2013-08-07 4 views
4

Всякий раз, когда я запускаю мое приложение Grails в первый раз, используя для поиска 0.6.4, я получаю следующее сообщение об ошибке:Searchable Плагин Не удается решить проблему класса в Grails 2.2.4

| 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 

Попытка запустить приложение, второй раз приводит к тому, что приложение работает как ожидалось.

Не showstopper, но, безусловно, хлопотно, любая идея о том, как решить это?

+0

Был ли ответ полезным? – dmahapatro

+0

Не получили решение попробовать. Я хотел сделать это сразу после того, как вы разместили работу, но просто еще не сделали этого. – starryknight64

+0

Должен ли плагин с возможностью поиска быть готовым прямо из ворот? Или это то, что мы должны ожидать от каждого плагина? – starryknight64

ответ

5

Верьте, что вам нужно запустить grails refresh-dependencies после добавления плагина в BuildConfig.groovy, но до run-app.

Это поможет в обновлении зависимостей приложения до тех двух файлов, которые присутствуют в lib плагина.

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

Поскольку эти зависимости не настроены в разделе зависимостей в BuildConfig плагина, но в lib, поэтому требуется команда refresh-dependencies.

Он работает в последующих попытках, потому что после того, как приложение скомпилировано или запущено, приложение становится осведомленным о транзитивных зависимостях, которые ему нужно извлечь из плагина.

+2

Спасибо, что он работал после предоставления 'grails refresh-dependencies' – Mahendran

+0

Это работает для меня, однако это кажется немного обход. Мое ожидание использования плагина состоит в том, что он строит с минимальной конфигурацией. Поскольку searchable требует почти никакой конфигурации, я бы ожидал, что он будет построен сразу, без необходимости «заправлять» сборку заранее. – starryknight64

8

Я должен добавить пару Maven РЕПО в BuildConfig.groovy

mavenRepo "http://repo.grails.org/grails/core" 
mavenRepo "https://oss.sonatype.org/content/repositories/releases/" 

А потом:

grails compile --non-interactive --refresh-dependencies 

Проверено на Граалей 2.3.7

+0

Спасибо, что это сработало для меня. – SudeepShakya