diff options
Diffstat (limited to 'apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/ApiRouteApp.java')
-rw-r--r-- | apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/ApiRouteApp.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/ApiRouteApp.java b/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/ApiRouteApp.java index fb8147d..697351a 100644 --- a/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/ApiRouteApp.java +++ b/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/ApiRouteApp.java @@ -32,6 +32,7 @@ import io.dropwizard.setup.Bootstrap; import io.dropwizard.setup.Environment; import io.swagger.jaxrs.config.BeanConfig; import io.swagger.jaxrs.listing.ApiListingResource; +import java.util.Optional; public class ApiRouteApp extends Application<ApiRouteAppConfig> { @@ -111,13 +112,15 @@ public class ApiRouteApp extends Application<ApiRouteAppConfig> { config.setResourcePackage("org.onap.msb.apiroute.resources"); SimpleServerFactory simpleServerFactory = (SimpleServerFactory) configuration.getServerFactory(); String basePath = simpleServerFactory.getApplicationContextPath(); - String rootPath = simpleServerFactory.getJerseyRootPath(); + Optional<String> optRootPath = simpleServerFactory.getJerseyRootPath(); + + String rootPath = optRootPath.get(); rootPath = rootPath.substring(0, rootPath.indexOf("/*")); basePath = basePath.equals("/") ? rootPath : (new StringBuilder()).append(basePath).append(rootPath).toString(); - LOGGER.warn("getApplicationContextPath: " + basePath); + LOGGER.info("getApplicationContextPath: " + basePath); config.setBasePath(basePath); config.setScan(true); } |