[ https://issues.apache.org/jira/browse/LIVY-615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16896746#comment-16896746 ]
Yiheng Wang commented on LIVY-615: ---------------------------------- Can you raise a PR for your patch? > livy.ui.basePath does not seem to work correctly > ------------------------------------------------ > > Key: LIVY-615 > URL: https://issues.apache.org/jira/browse/LIVY-615 > Project: Livy > Issue Type: Bug > Components: Server > Affects Versions: 0.6.0 > Reporter: Ferdinand de Antoni > Priority: Major > Original Estimate: 5m > Remaining Estimate: 5m > > When setting the property {{livy.ui.basePath}}, a HTTP error 404 is returned. > To resolve this problem, the context path in {{WebServer.scala}} should be > set as well, e.g.: > {code:java} > context.setContextPath(livyConf.get(LivyConf.SERVER_BASE_PATH)){code} > Adding this seems to resolve this problem. Note that this of course also > changes the context path of the API, not just the UI, but I presumed that was > also the intention of the {{livy.ui.basePath}} property. > Below patch of suggested changes: > {noformat} > Index: server/src/main/scala/org/apache/livy/server/WebServer.scala > IDEA additional info: > Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP > <+>UTF-8 > =================================================================== > --- server/src/main/scala/org/apache/livy/server/WebServer.scala (revision > 92062e1659db2af85711b1f35c50ff4050fec675) > +++ server/src/main/scala/org/apache/livy/server/WebServer.scala (revision > bdfb75d08bf34633ff23d7e4db380aca1fdf4d8e) > @@ -81,7 +81,7 @@ > val context = new ServletContextHandler() > - context.setContextPath("/") > + context.setContextPath(livyConf.get(LivyConf.SERVER_BASE_PATH)) > context.addServlet(classOf[DefaultServlet], "/") > val handlers = new HandlerCollection > @@ -114,7 +114,7 @@ > } > port = connector.getLocalPort > - info("Starting server on %s://%s:%d" format (protocol, host, port)) > + info("Starting server on %s://%s:%d/%s" format (protocol, host, port, > livyConf.get(LivyConf.SERVER_BASE_PATH))) > } > def join(): Unit = {{noformat} > -- This message was sent by Atlassian JIRA (v7.6.14#76016)