Grails2.3.3中的grails事件推送插件问题

Grails2.3.3中的grails事件推送插件问题,grails,grails-plugin,Grails,Grails Plugin,我在BuildConfig.groovy中有以下配置: plugins { ... compile ':events-push:1.0.M7' } 它可以很好地使用该更改更新项目。但是,当我启动应用程序时,我将获得: Running Grails application | Error 2014-01-14 23:59:33,800 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initi

我在BuildConfig.groovy中有以下配置:

plugins {
    ...
    compile ':events-push:1.0.M7'
}
它可以很好地使用该更改更新项目。但是,当我启动应用程序时,我将获得:

 Running Grails application
| Error 2014-01-14 23:59:33,800 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: Error creating bean with name 'grailsEventsPublisher': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'groovy.util.ConfigObject' to required type 'boolean' for property 'catchFlushExceptions'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [groovy.util.ConfigObject] to required type [boolean] for property 'catchFlushExceptions': PropertyEditor [org.springframework.beans.propertyeditors.CustomBooleanEditor] returned inappropriate value of type [groovy.util.ConfigObject]
Message: Error creating bean with name 'grailsEventsPublisher': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'groovy.util.ConfigObject' to required type 'boolean' for property 'catchFlushExceptions'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [groovy.util.ConfigObject] to required type [boolean] for property 'catchFlushExceptions': PropertyEditor [org.springframework.beans.propertyeditors.CustomBooleanEditor] returned inappropriate value of type [groovy.util.ConfigObject]
    Line | Method
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    724 | run . . . in java.lang.Thread

Caused by TypeMismatchException: Failed to convert property value of type 'groovy.util.ConfigObject' to required type 'boolean' for property 'catchFlushExceptions'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [groovy.util.ConfigObject] to required type [boolean] for property 'catchFlushExceptions': PropertyEditor [org.springframework.beans.propertyeditors.CustomBooleanEditor] returned inappropriate value of type [groovy.util.ConfigObject]
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    724 | run . . . in java.lang.Thread

Caused by IllegalArgumentException: Cannot convert value of type [groovy.util.ConfigObject] to required type [boolean] for property 'catchFlushExceptions': PropertyEditor [org.springframework.beans.propertyeditors.CustomBooleanEditor] returned inappropriate value of type [groovy.util.ConfigObject]
->>  334 | innerRun  in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    166 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    724 | run . . . in java.lang.Thread
Disconnected from the target VM, address: '127.0.0.1:51065', transport: 'socket'

这是否与在Grails 2.3.3中运行此版本的插件有关?

这看起来像是事件插件所依赖的平台核心插件中的一个bug。如果在
Config.groovy
中未设置值(通常在使用
ConfigSlurper
ConfigObject
时),属性的值在第一次访问时将是一个新的空
ConfigObject
。如果处理不当,这会导致奇怪的错误,例如,因为它是一个
映射,并且是空的,
toString()
值是
[:]
。空映射是Groovy false,因此使用
if
测试通常可以工作,但这里假设设置了布尔值

根据
doWithConfigOptions
块中的设置,
catchFlusheExceptions
的默认值似乎是
true
,因此将其添加到应用程序的
Config.groovy
将解决此问题:

plugin.platformCore.events.catchFlushExceptions = true

这看起来像是事件插件所依赖的平台核心插件中的一个bug。如果在
Config.groovy
中未设置值(通常在使用
ConfigSlurper
ConfigObject
时),属性的值在第一次访问时将是一个新的空
ConfigObject
。如果处理不当,这会导致奇怪的错误,例如,因为它是一个
映射,并且是空的,
toString()
值是
[:]
。空映射是Groovy false,因此使用
if
测试通常可以工作,但这里假设设置了布尔值

根据
doWithConfigOptions
块中的设置,
catchFlusheExceptions
的默认值似乎是
true
,因此将其添加到应用程序的
Config.groovy
将解决此问题:

plugin.platformCore.events.catchFlushExceptions = true

谢谢在春季安全中解决了一个类似问题的巨大难题谢谢!!,在Spring Security中解决了一个类似的问题