diff options
Diffstat (limited to 'policy-endpoints')
-rw-r--r-- | policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyJerseyServer.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyJerseyServer.java b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyJerseyServer.java index f882c927..4f7c151e 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyJerseyServer.java +++ b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyJerseyServer.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * policy-endpoints * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -129,12 +129,7 @@ public class JettyJerseyServer extends JettyServletServer { String hostname = this.connector.getHost(); if (hostname == null || hostname.isEmpty() || hostname.equals(NetworkUtil.IPv4_WILDCARD_ADDRESS)) { - try { - hostname = InetAddress.getLocalHost().getHostName(); - } catch (UnknownHostException e) { - logger.warn("{}: can't resolve connector's hostname: {}", this, hostname, e); - hostname = "localhost"; - } + hostname = NetworkUtil.getHostname(); } swaggerServlet.setInitParameter(SWAGGER_API_BASEPATH, |