Author: alessio.soldano(a)jboss.com
Date: 2011-05-11 18:06:52 -0400 (Wed, 11 May 2011)
New Revision: 14380
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
Log:
[JBWS-3199] AbstractServerConfig.toIPv6URLFormat throws java.net.UnknownHostException
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2011-05-11
19:53:20 UTC (rev 14379)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2011-05-11
22:06:52 UTC (rev 14380)
@@ -102,9 +102,18 @@
this.webServiceHost = toIPv6URLFormat("127.0.0.1".equals(host) ?
"localhost" : host); // TCK workaround
}
- private String toIPv6URLFormat(final String host) throws UnknownHostException
+ private String toIPv6URLFormat(final String host)
{
- final boolean isIPv6Address = !UNDEFINED_HOSTNAME.equals(host) &&
InetAddress.getByName(host) instanceof Inet6Address;
+ boolean isIPv6Address = false;
+ try
+ {
+ isIPv6Address = !UNDEFINED_HOSTNAME.equals(host) &&
InetAddress.getByName(host) instanceof Inet6Address;
+ }
+ catch (UnknownHostException e)
+ {
+ log.warn("Could not get address for host: " + host, e);
+ //ignore, leave isIPv6Address to false
+ }
final boolean isIPv6Formatted = isIPv6Address &&
host.startsWith("[");
return isIPv6Address && !isIPv6Formatted ? "[" + host +
"]" : host;
Show replies by date