Axis2 clustering with tomcat

I was recently working with the creating axis2 cluster by using tomcat. Instead of running axis as two different webapps in one tomcat instance, I used two different tomcat instances to create the cluster. But i faced a problem which is already mentioned in here.

at org.apache.axis2.clustering.state.DefaultStateManager.updateContexts(
at org.apache.axis2.clustering.state.Replicator.replicate(
at org.apache.axis2.receivers.AbstractMessageReceiver.replicateState(
at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(
at org.apache.axis2.receivers.AbstractMessageReceiver$
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$

I digged in to see the root cause for this and found that the ClusteringAgent (TribesClusteringAgent) was never initialized and this was causing the NPE in DefaultStateManager. This was because, by default, the parameter “AvoidInitiation” is set as “true” under the clustering section in axis2.xml. So when running axis2 in tomcat, this skips the initiation of the cluster when the ConfigurationContext is being build. This parameter is set to true if initialization is explicitly done by some other party other than axis2 server it self. This issue can be overcome by setting the parameter as “false“.  Then the clustering works as expected.

This post explains more about axis2 clustering on tomcat in detail.


About kishanthan

I’m currently working as a Software Engineer at WSO2, an open source software company. I hold an Engineering degree, majoring in Computer Science & Engineering field, from University of Moratuwa, Sri Lanka.
This entry was posted in Axis2, How to, Java, Tomcat and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s