you can disable the jmx statistics in JBossCache, but that would rather be a workaround.
You should check why the MBean with the given name doesn't get unregistered.
Disabling jmxStatistics does not help. I still got the same issue. But after doing more research, I came to know that this is the problem (or feature not sure :) ) with Websphere AS.
I am trying to find out the solutions. If in the mean time, someone comes across some solution/workaround, please post here.
Some more information:
Websphere appends cellName, nodeName and server name (node1) to whever ClusterName I specify in the treecache.xml. During hot deployment, jboss cache jars try to find if there is any MBean with name TreeCache-Cluster. It does not find any and tries to create a new MBean with Name TreeCache-Cluster. In the process, websphere again appends the same information (cellName, nodeName ...etc) and it finds that there is bean with this name already exists and hence I get the exception.
For the sake of experiment: I gave the name to ClusterName attribute as
TreeCache-Cluster,cell=TD2471N, which Websphere was complaining. And it all started working OK.
But this definitely not a solution because this information is machine specific.
Let me know how to fix it.
Once you disabled the jmxStats, JBossCache does not try to bind anything to the mbean server. Even more, the mbean object name for JBC3.0.0 or greater should be jboss.cache:service=JBossCache, and not jboss.cache:service=TreeCache. Can you double check the JBC version you are using?
Thanks Mircea.Markus for pointing me in right direction.
I am able to fix the problem. I upgraded my cache jars to 'Malagueta' version of JBC 3.2.0GA. Also there was one old jar file of JBC which was creating the conflict. Then I also tested the cluster name other than jboss.cache:service=TreeCache and that worked all well, no issues. :)[/img]