【问题标题】:grails 2.4.2 searchable plugingrails 2.4.2 可搜索插件
【发布时间】:2014-09-02 14:22:34
【问题描述】:

我已经在 grails 2.4.2 中安装了可搜索插件。

compile ":searchable:0.6.9"

它安装成功,但是当我运行应用程序时,它给出了这个错误。我没有制作任何控制器。只有一个被声明为可搜索的域类。如何解决?

Sep 2, 2014 7:34:11 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
Sep 2, 2014 7:34:11 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
| Running Grails application
Sep 2, 2014 7:34:24 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
Error |
2014-09-02 19:34:57,557 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener  - Error initializing the application:
Error creating bean with name 'grails.plugin.searchable.SearchableController': Initialization of bean failed; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchableService': Initialization of be
an failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compass':
FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
Message: Error creating bean with name 'grails.plugin.searchable.SearchableController': Initialization of bean failed; nested exc
eption is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchableService': Initializat
ion of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'c
ompass': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
   Line | Method
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|   138 | run      in java.util.concurrent.FutureTask
|   885 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
|   907 | run      in     ''
^   619 | run . .  in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'searchableService': Initialization of bean failed; nested excepti
on is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compass': FactoryBean threw excepti
on on object creation; nested exception is java.lang.NullPointerException   
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|   138 | run      in java.util.concurrent.FutureTask
|   885 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
|   907 | run      in     ''
^   619 | run . .  in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'compass': FactoryBean threw exception on object creation; nested
exception is java.lang.NullPointerException
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|   138 | run      in java.util.concurrent.FutureTask
|   885 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
|   907 | run      in     ''
^   619 | run . .  in java.lang.Thread
Caused by NullPointerException: null
->> 303 | addAll   in java.util.AbstractCollection
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|   121 | configure in grails.plugin.searchable.internal.compass.config.DefaultGrailsDomainClassMappingSearchableCompassConfigura
tor
|    39 | configure in grails.plugin.searchable.internal.compass.config.CompositeSearchableCompassConfigurator
|    93 | buildCompass in grails.plugin.searchable.internal.compass.spring.SearchableCompassFactoryBean
|    58 | getObject in     ''
|    41 | getObject in     ''
|   303 | innerRun in java.util.concurrent.FutureTask$Sync
|   138 | run      in java.util.concurrent.FutureTask
|   885 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
|   907 | run      in     ''
^   619 | run . .  in java.lang.Thread
| Error Forked Grails VM exited with error

【问题讨论】:

  • 我认为是因为 Grails 2.4.x 使用了 Hibernate 4,而可搜索插件仅支持 Hibernate 3。请查看 BuildConfig.groovy 文件。您应该能够将 Hibernate 3 与 Grails 2.4.x 一起使用
  • 你应该去阅读这篇博文:jolorenz.wordpress.com/2013/10/02/…

标签: grails grails-plugin searchable


【解决方案1】:

您可以尝试使用命令行安装可搜索插件吗?

grails install-plugin 可搜索(我假设您使用的是 java 1.5+)

安装插件后,请尝试使您的域可搜索,因为我相信可搜索控制器和服务类是在安装过程中创建的。

【讨论】:

  • 它不工作@user1313900。它说 installPlugin 不能在 2.3 以上的 Grails 版本中工作
  • grails install-plugin searchable 0.6.9
【解决方案2】:

您使用的是哪个版本的 Hibernate 插件?请注意,可搜索插件不适用于 Hibernate 4;您必须改用 Hibernate 3。

【讨论】:

    猜你喜欢
    • 2011-05-02
    • 1970-01-01
    • 2012-02-06
    • 1970-01-01
    • 2012-12-17
    • 2014-11-19
    • 2014-08-20
    相关资源
    最近更新 更多