spring - chalice 2.0.1 : async messaging: `jmsConnectionFactory` compilation error

标签 spring grails groovy javabeans

我有 resource.groovy

beans = {
    jmsConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) { brokerURL = 'vm://localhost' }
}

在运行时它说

 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

升级前一切正常,更新到 2.0.1 后失败并出现此错误,我使用的是 groovy 编译器 1.8.6

最佳答案

我一直在 Grails 中配置 ActiveMQ,如下所示:

BuildConfig.groovy

dependencies {
    compile 'org.apache.activemq:activemq-core:5.5.0'
}

资源.groovy

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

beans = {
    jmsConnectionFactory(SingleConnectionFactory) {
        targetConnectionFactory = { ActiveMQConnectionFactory cf ->
            brokerURL = 'vm://localhost'
        }
    }
}

关于spring - chalice 2.0.1 : async messaging: `jmsConnectionFactory` compilation error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9453115/

相关文章:

java - Spring MVC with CSS - 请求的资源不可用

spring - 如何在 Spring Boot Activity 中设置 Business Key

java - 在 Spring MVC 中设置 session 超时

generics - Grails 类型检查/CompileStatic/GrailsCompileStatic

java - 获取引擎名称时出现空异常?

java - OOP 如何判断从实现的接口(interface)调用了哪个类方法

grails - 将基于createBriteria的订单基于基于EmiratesTo属性

java - Grails 依赖解析

gradle - 无法运行通过gradle编译的groovy代码构建的jar文件

linux - 配置 Jenkins 在构建时通过构建参数以编程方式确定从属?