Using place-holder in the "standalone-ha.xml" (Jboss AS7)
thomas2008ch Jun 14, 2013 3:15 AMHi,
I use the tcp-clustering and in the standalone-ha.xml one can define this as follow:
[code]
...
<stack name="tcp">
<transport socket-binding="jgroups-tcp" type="TCP"/>
<protocol type="TCPPING">
<property name="initial_hosts">
172.23.17.41[7600],172.23.17.43[7600]
</property>
...
[/code]
Since I don't want to hard coding the IP-Address in the file, I use the place holder such as follow:
[code]
...
<stack name="tcp">
<transport socket-binding="jgroups-tcp" type="TCP"/>
<protocol type="TCPPING">
<property name="initial_hosts">
${tcp.initial_hosts}
...
[/code]
And in a properties file I define the place holder as follow:
[code]
...
tcp.initial_hosts=172.23.17.41[7600],172.23.17.43[7600]
...
/[code]
But as I start the Jboss I got error in server.log:
[code]
...
09:14:22,680 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 54) MSC000001: Failed to start service jboss.jgroups.channel.web: org.jboss.msc.service.StartException in service jboss.jgroups.channel.web: java.lang.Exception: String value could not be converted for method initial_hosts in TCPPING with default value ${tcp.initial_hosts}.Exception is java.lang.Exception: Conversion of initial_hosts in TCPPING with original property value ${tcp.initial_hosts} failed
at org.jboss.as.clustering.jgroups.subsystem.ChannelService.start(ChannelService.java:51)
at org.jboss.as.clustering.msc.AsynchronousService$1.run(AsynchronousService.java:82) [jboss-as-clustering-common.jar:7.1.3.Final-redhat-4]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads.jar:2.0.0.GA-redhat-2]
Caused by: java.lang.Exception: String value could not be converted for method initial_hosts in TCPPING with default value ${tcp.initial_hosts}.Exception is java.lang.Exception: Conversion of initial_hosts in TCPPING with original property value ${tcp.initial_hosts} failed
at org.jgroups.stack.Configurator.createInetAddressMap(Configurator.java:697)
at org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:94)
at org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:55)
at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:465)
at org.jgroups.JChannel.init(JChannel.java:795)
at org.jgroups.JChannel.<init>(JChannel.java:166)
at org.jboss.as.clustering.jgroups.MuxChannel.<init>(MuxChannel.java:37)
at org.jboss.as.clustering.jgroups.JChannelFactory.createChannel(JChannelFactory.java:78)
at org.jboss.as.clustering.jgroups.subsystem.ChannelService.start(ChannelService.java:44)
... 5 more
Caused by: java.lang.Exception: Conversion of initial_hosts in TCPPING with original property value ${tcp.initial_hosts} failed
at org.jgroups.conf.PropertyHelper.getConvertedValue(PropertyHelper.java:85)
at org.jgroups.stack.Configurator.createInetAddressMap(Configurator.java:694)
... 13 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1911) [rt.jar:1.7.0_17]
at org.jgroups.util.Util.parseCommaDelimitedHosts(Util.java:2799)
at org.jgroups.conf.PropertyConverters$InitialHosts.convert(PropertyConverters.java:65)
at org.jgroups.conf.PropertyHelper.getConvertedValue(PropertyHelper.java:82)
... 14 more
...
[/code]
How can I fix it?