grails 2.4.2可搜索的插件

时间:2014-09-02 14:22:35

标签: grails grails-plugin searchable

我已经在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

2 个答案:

答案 0 :(得分:0)

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

grails install-plugin searchable(我假设你使用的是java 1.5 +)

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

答案 1 :(得分:0)

您使用的是什么版本的Hibernate插件?请注意,Searchable插件不适用于Hibernate 4;你必须使用Hibernate 3。