grails activemq application doesn't work for jelastic paas

Trying to deploy my grails app to jelastic environment and having a proper TomEE app server configured and all the plugins related to activemq I got the following exception on the server:

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

On my local environment I use IntelliJ with the embedded tomcat and tomEE servers and it works properly. I suppose the issue is related to the fact that activemq doesn't have enough rights in order to create some files on the disk. Unfortunetly I'm not able to figure out where is the problem. Any advise is highly appreciated.

Answers


Find below the solution that works for Jelastic (tomcat 7, java7, grails 2.2.4) environment:

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'

resources.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)
 }
}

Embedded activemq started without any issues.


Need Your Help

Looking for a JavaScript carousel

javascript jquery jcarousel

I am looking for a JavaScript based carousel such as absolute website. The main part that I am interested in is that it slides in a similar way to the main site flash, highlighting one item/image a...

Center input search with the menu bar

html css

I have a menu bar with Home // Novedades // Categorias // Profile with an specify design and I want to put an input type search in middle of them