4

每当我第一次使用可搜索的 0.6.4 运行 Grails 应用程序时,都会收到以下错误:

| 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

尝试再次运行应用程序会导致应用程序按预期运行。

不是一个展示者,但肯定很麻烦,关于如何解决这个问题的任何想法?

4

2 回答 2

8

我需要在 BuildConfig.groovy 中添加几个 Maven 存储库

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

接着:

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

在 grails 2.3.7 上测试

于 2014-05-01T08:07:31.500 回答
5

相信你需要grails refresh-dependencies在插件添加后运行,BuildConfig.groovy但在run-app.

这将有助于刷新应用程序对lib插件中存在的这两个文件的依赖关系。

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

由于这些依赖项未在BuildConfig插件的依赖项部分中配置,而是在 中配置lib,因此refresh-dependencies需要命令。

它在后续尝试中起作用,因为一旦应用程序被编译或运行,应用程序就会意识到它需要从插件中提取的传递依赖项。

于 2013-08-07T03:14:53.560 回答