本文基于上一篇
将mod_cluster.sar拷贝到JBOSS_HOME/server/default/deploy目录下
将mod_cluster.sar\META-IN\mod_cluster-jboss-beans.xml里面ModClusterListener的ContainerEventHandler由HAModClusterService改为ModClusterService
<!-- Entry point: catalina lifecycle listener -->
<bean name="ModClusterListener" class="org.jboss.modcluster.container.jbossweb.JBossWebEventHandlerAdapter">
<constructor>
<parameter class="org.jboss.modcluster.container.ContainerEventHandler">
<!-- <inject bean="HAModClusterService"/> -->
<inject bean="ModClusterService"/>
</parameter>
<parameter class="javax.management.MBeanServer"><inject bean="JMXKernel" property="mbeanServer"/></parameter>
</constructor>
<depends>WebServer</depends>
</bean>
<bean name="ModClusterService" class="org.jboss.modcluster.ModClusterService" mode="On Demand">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=ModCluster",exposedInterface=org.jboss.modcluster.ModClusterServiceMBean.class)</annotation>
<constructor>
<parameter class="org.jboss.modcluster.config.impl.ModClusterConfig"><inject bean="ModClusterConfig"/></parameter>
<parameter class="org.jboss.modcluster.load.LoadBalanceFactorProvider"><inject bean="DynamicLoadBalanceFactorProvider"/></parameter>
</constructor>
</bean>
org.jboss.modcluster.config.ModClusterConfig 修改为
org.jboss.modcluster.config.impl.ModClusterConfig
本文参考:https://developer.jboss.org/message/763783