简体   繁体   中英

Failed to configure custom ActiveMQ broker in TomEE

Until now I used the default ActiveMQ configuration in TomEE. Now I would like to turn on scheduler support, so I added these things to tomee.xml:

<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
    BrokerXmlConfig = broker:(tcp://127.0.0.1:61616)?usekahadb=true&amp;persistent=true&amp;schedulerSupport=true
</Resource>

<Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
    ResourceAdapter = MyJmsResourceAdapter
</Resource>

But I get these error messages:

Database activemq-data/localhost/scheduler/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: Failed to create directory 'activemq-data/localhost/scheduler'

Can anyone help me what to do? Every documentation that I found about configuring ActiveMQ inside TomEE is sadly poor, and I cannot figure out how to turn on scheduler support inside TomEE .

The problem was that the base directory for ActiveMQ inside TomEE is the TomEE's bin folder and it was not writeable by TomEE so TomEE could not create folders for KahaDB. Making bin writeable for tomee process solved the problem.

After ActiveMQ created necessary folders, I have changed permissions on bin folder back to the original state (for security reason).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM