gpt4 book ai didi

grails activemq 应用程序不适用于 jelastic paas

转载 作者:行者123 更新时间:2023-12-01 18:14:59 26 4
gpt4 key购买 nike

尝试将我的grails应用程序部署到jelastic环境并配置正确的TomEE应用程序服务器以及与activemq相关的所有插件,我在服务器上遇到以下异常:

INFO: For help or more information please see: http://activemq.apache.org
2016-03-06 20:04:17,194 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: Error creating bean with name 'myBrokerService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.activemq.usage.TempUsage.getStore()Lorg/apache/activemq/store/kahadb/plist/PListStore;
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myBrokerService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.activemq.usage.TempUsage.getStore()Lorg/apache/activemq/store/kahadb/plist/PListStore;
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.apache.activemq.usage.TempUsage.getStore()Lorg/apache/activemq/store/kahadb/plist/PListStore;
at org.apache.activemq.xbean.XBeanBrokerService.ensureSystemUsageHasStore(XBeanBrokerService.java:72)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:56)
... 5 more

在我的本地环境中,我将 IntelliJ 与嵌入式 tomcat 和 tomEE 服务器一起使用,并且它工作正常。我认为该问题与 activemq 没有足够的权限在磁盘上创建一些文件有关。不幸的是我无法弄清楚问题出在哪里。非常感谢任何建议。

最佳答案

在下面找到适用于 Jelastic(tomcat 7、java7、grails 2.2.4)环境的解决方案:

BuildConfig.groovy:

compile 'org.grails.plugins:jms:1.3'
compile 'org.apache.activemq:activemq-core:5.7.0'
compile 'org.apache.xbean:xbean-spring:4.1'

资源.groovy:

import org.apache.activemq.broker.TransportConnector
import org.apache.activemq.xbean.XBeanBrokerService
import org.springframework.jms.connection.SingleConnectionFactory

beans = {

tcpConnector(TransportConnector,uri:'tcp://localhost:61616'){}

connectors(ArrayList,[ref('tcpConnector')]){}
myBrokerService(XBeanBrokerService){bean->
myBrokerService.useJmx = false
myBrokerService.persistent = true
myBrokerService.dataDirectory = 'my-activemq_data'
myBrokerService.transportConnectors = ref('connectors')
}
amqConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) {
brokerURL = 'vm://localhost'
}

jmsConnectionFactory(SingleConnectionFactory) { bean ->
targetConnectionFactory = ref(amqConnectionFactory)
}
}

嵌入式 activemq 启动时没有任何问题。

关于grails activemq 应用程序不适用于 jelastic paas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35845017/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com