Grails 2.0.1:异步消息:`jmsConnectionFactory`编译错误

Jig*_*shi 1 grails groovy spring javabeans

我有resource.groovy

beans = {
    jmsConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) { brokerURL = 'vm://localhost' }
}
Run Code Online (Sandbox Code Playgroud)

并在运行它说

 Running Grails application
| Error 2012-02-24 18:02:13,490 [pool-6-thread-1] ERROR spring.GrailsRuntimeConfigurator  - [RuntimeConfiguration] Unable to load beans from resources.groovy
Message: No such property: org for class: resources
   Line | Method
->>   3 | doCall                    in resources$_run_closure1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   736 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
|   569 | beans . . . . . . . . . . in     ''
|   736 | invokeBeanDefiningClosure in     ''
|   569 | beans . . . . . . . . . . in     ''
|   511 | invokeMethod              in     ''
|   303 | innerRun . . . . . . . .  in java.util.concurrent.FutureTask$Sync
|   138 | run                       in java.util.concurrent.FutureTask
|   886 | runTask . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
|   908 | run                       in     ''
^   662 | run . . . . . . . . . . . in java.lang.Thread
| Error 2012-02-24 18:02:16,537 [pool-6-thread-1] ERROR context.GrailsContextLoader  - Error executing bootstraps: Error creating bean with name 'delayedCreateMessageJmsListenerContainer': Cannot resolve reference to bean 'jmsConnectionFactory' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'jmsConnectionFactory' is defined
Message: Error creating bean with name 'delayedCreateMessageJmsListenerContainer': Cannot resolve reference to bean 'jmsConnectionFactory' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'jmsConnectionFactory' is defined
Run Code Online (Sandbox Code Playgroud)

它在升级之前运行良好,在更新到2.0.1之后它失败并出现此错误,我正在使用groovy编译器1.8.6

jam*_*man 5

我总是在Grails中配置ActiveMQ,如下所示:

BuildConfig.groovy

dependencies {
    compile 'org.apache.activemq:activemq-core:5.5.0'
}
Run Code Online (Sandbox Code Playgroud)

resources.groovy

import org.springframework.jms.connection.SingleConnectionFactory
import org.apache.activemq.ActiveMQConnectionFactory

beans = {
    jmsConnectionFactory(SingleConnectionFactory) {
        targetConnectionFactory = { ActiveMQConnectionFactory cf ->
            brokerURL = 'vm://localhost'
        }
    }
}
Run Code Online (Sandbox Code Playgroud)