difin commented on code in PR #5652:
URL: https://github.com/apache/hive/pull/5652#discussion_r2010262432


##########
common/src/java/org/apache/hive/http/HttpServer.java:
##########
@@ -489,13 +496,13 @@ static boolean userHasAdministratorAccess(ServletContext 
servletContext,
   /**
    * Create the web context for the application of specified name
    */
-  WebAppContext createWebAppContext(Builder b) {
+  WebAppContext createWebAppContext(Builder b) throws FileNotFoundException {
     WebAppContext ctx = new WebAppContext();
     setContextAttributes(ctx.getServletContext(), b.contextAttrs);
     ctx.getServletContext().getSessionCookieConfig().setHttpOnly(true);
     ctx.setDisplayName(b.name);
-    ctx.setContextPath("/");
-    ctx.setWar(appDir + "/" + b.name);
+    ctx.setContextPath(b.contextPath == null ? "/" : b.contextPath);
+    ctx.setWar(getWebAppsPath(b.name) + "/" + b.name);

Review Comment:
   Previously it was `ctx.setContextPath("/");` This is has to change because 2 
web apps cannot have the same context path on the same web server. Health check 
web app has a different context path than WebUI.
   
   I refactored `ctx.setContextPath(b.contextPath == null ? "/" : 
b.contextPath);` to `ctx.setContextPath(b.contextPath)` and added the default 
contextPath value of "/" in the `HttpServer.Builder`.
   
   `ctx.setWar(getWebAppsPath(b.name) + "/" + b.name);` is needed because each 
web app has a different app dir. See `service/target/hive-webapps/ `



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to