指定persistenceAdapter时ActiveMQ代理配置错误:“应为'{WC [## other:“ http://activemq.apache.org/schema/core”]}中的一个”

0 spring activemq-classic

我正在设置一个简单的ActiveMQ嵌入式代理。在我尝试配置持久性适配器之前,它工作正常。我基本上只是从http://activemq.apache.org/persistence.html#Persistence-ConfiguringKahaPersistence复制配置。当我将此配置添加到我的Spring配置中时,如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:amq="http://activemq.apache.org/schema/core"
   xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd">

<amq:broker useJmx="true" persistent="true" brokerName="localhost">
    <amq:transportConnectors>
        <amq:transportConnector name="vm" uri="vm://localhost"/>            
    </amq:transportConnectors>
   <amq:persistenceAdapter>
    <amq:kahaPersistenceAdapter directory="activemq-data" maxDataFileLength="33554432"/>
   </amq:persistenceAdapter>
  </amq:broker>
   </beans>
Run Code Online (Sandbox Code Playgroud)

我得到错误:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'amq:persistenceAdapter'. 
 One of '{WC[##other:"http://activemq.apache.org/schema/core"]}' is expected.
Run Code Online (Sandbox Code Playgroud)

当我取出amq:persistenceAdapter元素时,它可以正常工作。无论我在主体中包括哪个持久适配器,例如jdbc,journal等,都会发生相同的错误。

任何帮助将不胜感激。

谢谢。

bsn*_*der 5

我现在不记得为什么,但是发生了意外更改,要求元素必须按字母顺序排列。尝试将persistenceAdapter放在transportConnectors之前。

布鲁斯