mysql - 使用 MySQL 配置 ActiveMQ

标签 mysql activemq

我需要使用 MySQL 设置 ActiveMQ,我遵循了这篇文章 http://note19.com/2007/06/23/configure-activemq-with-mysql/

我发现我是否有以下配置。 MQ无法启动

 <bean id="mysql-ds"
       class="org.apache.commons.dbcp.BasicDataSource"
       destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url"
            value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
    <property name="username" value="xxxx"/>
    <property name="password" value="xxxx"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>

错误如下

2012-05-25 18:40:46,565 | ERROR | Failed to load: class path resource [activemq.xml], reason: Line 109 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 109; columnNumber: 40; cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'. One of '{"http://activemq.apache.org/schema/core":adminView, "http://activemq.apache.org/schema/core":brokerContext, "http://activemq.apache.org/schema/core":consumerSystemUsage, "http://activemq.apache.org/schema/core":destinationFactory, "http://activemq.apache.org/schema/core":destinationInterceptors, "http://activemq.apache.org/schema/core":destinationPolicy, "http://activemq.apache.org/schema/core":destinations, "http://activemq.apache.org/schema/core":ioExceptionHandler, "http://activemq.apache.org/schema/core":jmsBridgeConnectors, "http://activemq.apache.org/schema/core":managementContext, "http://activemq.apache.org/schema/core":messageAuthorizationPolicy, "http://activemq.apache.org/schema/core":networkConnectorURIs, "http://activemq.apache.org/schema/core":networkConnectors, "http://activemq.apache.org/schema/core":persistenceAdapter, "http://activemq.apache.org/schema/core":persistenceFactory, "http://activemq.apache.org/schema/core":persistenceTaskRunnerFactory, "http://activemq.apache.org/schema/core":plugins, "http://activemq.apache.org/schema/core":producerSystemUsage, "http://activemq.apache.org/schema/core":proxyConnectors, "http://activemq.apache.org/schema/core":regionBroker, "http://activemq.apache.org/schema/core":services, "http://activemq.apache.org/schema/core":shutdownHooks, "http://activemq.apache.org/schema/core":sslContext, "http://activemq.apache.org/schema/core":systemUsage, "http://activemq.apache.org/schema/core":taskRunnerFactory, "http://activemq.apache.org/schema/core":tempDataStore, "http://activemq.apache.org/schema/core":transportConnectorURIs, "http://activemq.apache.org/schema/core":transportConnectors, WC[##other:"http://activemq.apache.org/schema/core"]}' is expected. | org.apache.activemq.xbean.XBeanBrokerFactory | main org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 109 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 109; columnNumber: 40; cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'. One of '{"http://activemq.apache.org/schema/core":adminView, "http://activemq.apache.org/schema/core":brokerContext, "http://activemq.apache.org/schema/core":consumerSystemUsage, "http://activemq.apache.org/schema/core":destinationFactory, "http://activemq.apache.org/schema/core":destinationInterceptors, "http://activemq.apache.org/schema/core":destinationPolicy, "http://activemq.apache.org/schema/core":destinations, "http://activemq.apache.org/schema/core":ioExceptionHandler, "http://activemq.apache.org/schema/core":jmsBridgeConnectors, "http://activemq.apache.org/schema/core":managementContext, "http://activemq.apache.org/schema/core":messageAuthorizationPolicy, "http://activemq.apache.org/schema/core":networkConnectorURIs, "http://activemq.apache.org/schema/core":networkConnectors, "http://activemq.apache.org/schema/core":persistenceAdapter, "http://activemq.apache.org/schema/core":persistenceFactory, "http://activemq.apache.org/schema/core":persistenceTaskRunnerFactory, "http://activemq.apache.org/schema/core":plugins, "http://activemq.apache.org/schema/core":producerSystemUsage, "http://activemq.apache.org/schema/core":proxyConnectors, "http://activemq.apache.org/schema/core":regionBroker, "http://activemq.apache.org/schema/core":services, "http://activemq.apache.org/schema/core":shutdownHooks, "http://activemq.apache.org/schema/core":sslContext, "http://activemq.apache.org/schema/core":systemUsage, "http://activemq.apache.org/schema/core":taskRunnerFactory, "http://activemq.apache.org/schema/core":tempDataStore, "http://activemq.apache.org/schema/core":transportConnectorURIs, "http://activemq.apache.org/schema/core":transportConnectors, WC[##other:"http://activemq.apache.org/schema/core"]}' is expected.

引用:

  1. mysql Ver 14.14 Distrib 5.5.22,用于使用 readline 6.2 的 debian-linux-gnu (x86_64)
  2. activemq 版本 5.6.0

最佳答案

我猜您是在 broker 标记内提供定义。请在代理外部创建数据源 bean。请引用这个link .

关于mysql - 使用 MySQL 配置 ActiveMQ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10764694/

相关文章:

websocket - 断开连接时重新连接 stomp

MySQL 选择表是否存在

php - 检查远程主机上的 mysql 状态

php - 将 PHP 变量设置为 MySQL 行中的最新值

java - JMS (ActiveMQ) 性能

java - JMS 消息选择器不起作用

transactions - ActiveMQ 是否支持多个事务性消费者?

java - 是否可以将 activemq 代理嵌入到我的 servlet 容器中?

php - 无法包含 dbconenct.php

mysql - 查询模型的不同实例 + 另一个字段