Hornetq 与 JBoss4集成

本文详细介绍了如何将Hornetq消息中间件集成到JBOSS应用服务器中,包括下载、配置修正及启动步骤,并解决了可能出现的运行错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、下载Hornetq,URL:http://www.jboss.org/hornetq/downloads这里使用2.2.5.Final
2、解压Hornetq
3、指定需要安装Hornetq的JBOSS4目录
修改hornetq-2.2.5.Final\config\jboss-as-4\build.xml手动设置JBOSS_HOME,把

<property environment="ENV"/>

改为:

<property environment="ENV1"/>
<property name="ENV.JBOSS_HOME" value="E:/Server/jboss-4.2.2.GA"/>

4、修正Hornetq的错误配置
修改

hornetq-2.2.5.Final\config\jboss-as-4\clustered\jms-ds.xml

中的配置,删除</mbean>前的那个多余的</attribute>标签。
修改

hornetq-2.2.5.Final\config\jboss-as-4\clustered\ra.xml
hornetq-2.2.5.Final\config\jboss-as-4\non-clustered\ra.xml

中的配置,因为这个配置写错了,把

<config-property>
<description>The class that will locate the transactionmanager</description>
<config-property-name>TransactionManagerLocatorMethod</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.hornetq.integration.jboss.tm.JBoss4TransactionManagerLocator</config-property-value>
</config-property>

改为:

<config-property>
<description>The class that will locate the transactionmanager</description>
<config-property-name>TransactionManagerLocatorClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.hornetq.integration.jboss.tm.JBoss4TransactionManagerLocator</config-property-value>
</config-property>

5、运行安装
运行hornetq-2.2.5.Final\config\jboss-as-4\build.bat,前提是要安装JDK和ANT,安装成功后会默认安装两个JBoss实例all-with-hornetq和default-with-hornetq,这两实例是基于原来all和default实例配置,直接复制原来实例配置然后再修改的。
6、添加启动脚本
到jboss-4.2.2.GA\server目录下,添加一个批处理文件,文件名为JBOSS实例的名称,下面的脚本会自动运行与bat文件名称相同的JBoss实例,如:default-with-hornetq.bat
内容如下:

%~dp0..\bin\run.bat -c %~n0 -b 0.0.0.0

7、运行错误处理
如果运行过程中出现以下错误,那说明你在复制JBOSS的实例的时候把data目录的hornetq数据也复制了,解决办法是删除data下面的所有数据。

WARN [org.hornetq.core.cluster.impl.DiscoveryGroupImpl] There are more than one servers on the network broadcasting the same node id. You will see this message exactly once (per node) if a node is restarted, in which case it can be safely ignored. But if it is logged continuously it means you really do have more than one node on the same network active concurrently with the same node id. This could occur if you have a backup node active at the same time as its live node.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值