| Author |
JBOSS 5.1 config properties for clusters
|
Sandeep Awasthi
Ranch Hand
Joined: Oct 23, 2003
Posts: 597
|
|
While configuring jboss clusters, many properties are accessed in MBean configuration using standard ${propertyName} notations. For example
jboss.partition.name:DefaultPartition
<cluster-config>
<partition-name>${jboss.partition.name:DefaultPartition}</partition-name>
</cluster-config>
Where exactly these properties are defined. I have deployed one MBean which depends on ${jboss.partition.name:DefaultPartition} in MBean configuration xml. I get error and does not work. So I removed ${} and used hardcoded like following
<depends>jboss:service=DefaultPartition</depends> instead of <depends>${jboss:service=DefaultPartition}</depends>
it says
DEPLOYMENTS IN ERROR:
Deployment "jboss:service=DefaultPartition" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss:service=DefaultPartition' **
But MBean works ok.
Thanks.
|
Sandeep
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8209
|
|
Sandeep Awasthi wrote:While configuring jboss clusters, many properties are accessed in MBean configuration using standard ${propertyName} notations. For example
jboss.partition.name:DefaultPartition
<cluster-config>
<partition-name>${jboss.partition.name:DefaultPartition}</partition-name>
</cluster-config>
Where exactly these properties are defined.
A property of the form ${property.name:DefaulValue} in JBoss, is set to "DefaultValue" if the property.name is not already set. The value after the ":" acts as the default value. So in your example:
The jboss.partition.name will be set to DefaultPartition if you don't pass the jboss.partition.name as a system property:
Sandeep Awasthi wrote:
I have deployed one MBean which depends on ${jboss.partition.name:DefaultPartition} in MBean configuration xml.
An MBean cannot depend on a property value. It can only depend on other MBeans. The < depends> element expects the ObjectName of the other MBean.
|
[My Blog] [JavaRanch Journal]
|
 |
Sandeep Awasthi
Ranch Hand
Joined: Oct 23, 2003
Posts: 597
|
|
Thanks Jaikiran.
I referred this and one more link which I forgot after searching google.
On the link above I posted, the configuration is mentioned as
I think it is for older version of JBOSS.
|
 |
Bando Perez
Greenhorn
Joined: Oct 21, 2011
Posts: 2
|
|
This bastardo problem had me going around in circles for a while so I'll post the solution here:
Add the following to your org.jboss.ha.singleton.HASingletonController MBean in your jboss-service.xml or xxx-service.xml
Many online guides for JBoss 5 are wrong in this aspect and give obsolete information, e.g: http://docs.jboss.org/jbossas/docs/Clustering_Guide/5/pdf/Clustering_Guide.pdf [Ch.5, p.64]
A more up to date solution would be to deploy it as a bean instead of a service MBean using a separate jboss-beans.xml, see http://community.jboss.org/thread/64808
Adios
|
 |
 |
|
|
subject: JBOSS 5.1 config properties for clusters
|
|
|