diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-26 09:16:26 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-26 09:16:26 +0000 |
commit | c9b5ed4ae03d075c3f2c88870c19d0271c57ae9e (patch) | |
tree | 481848c7d6fc91284b62c16b015107e23938babf /sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main | |
parent | 5683a2da87f2713a135fdf6a1ef4e5bc6999bf45 (diff) |
Avoid NPE when no network is found
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@937974 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main')
-rw-r--r-- | sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryConfig.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryConfig.java b/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryConfig.java index da604d717b..c6b1ccaa21 100644 --- a/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryConfig.java +++ b/sca-java-2.x/trunk/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryConfig.java @@ -48,7 +48,7 @@ import java.util.Properties; */
public class RegistryConfig {
- private String bindAddress;
+ private String bindAddress = "*";
private int bindPort = 14820;
private boolean multicastDisabled = false;
private String multicastAddress = "224.5.12.10";
@@ -66,7 +66,10 @@ public class RegistryConfig { String bindValue = properties.getProperty("bind");
if (bindValue == null) {
- this.bindAddress = chooseLocalAddress().getHostAddress();
+ InetAddress addr = chooseLocalAddress();
+ if (addr != null) {
+ this.bindAddress = addr.getHostAddress();
+ }
} else {
if (bindValue.indexOf(":") == -1) {
this.bindAddress = bindValue;
|