If you have tried starting your standalone or domain set of cluster nodes, you will be surprised that there is no information at all about clustering in your server logging. Believe it, it is not a bug, but a feature! One of the key features of JBoss AS 7 is that only a minimal set of services is started; therefore, in order to see a cluster's live demonstration, you need to deploy a cluster-aware application. In order to trigger clustering libraries in your application, you can follow two approaches:
If your application uses Enterprise JavaBeans, you can tag it as clusterable by adding a JBoss proprietary annotation,
(@org.jboss.ejb3.annotation.Clustered
), or via the EJB configuration file (jboss-ejb3.xml
)If your application includes a web application archive, you can use the portable
<distributable />
element in yourweb.xml
file. Let's see both the approaches, starting from clustering EJBs.