zhangbeiyuan-hw opened a new issue #1627: 静态页面直接部署到gateway-service,提示 root cannot start with '/' URL: https://github.com/apache/servicecomb-java-chassis/issues/1627 配置WEBAPP_ROOT的时候,试过绝对路径/usr/app/configs/static/ 和 相对路径./configs/static/ 都不行,在window本地调试可以,部署到linux k8s上就不行了。 配置如下: WEBAPP_ROOT=./configs/static/ Java代码如下: ···java @Override public void init(Router router) { String regex = "/(.*)"; String webappPath = InitConfig.getValue(InitConfig.WEBAPP_ROOT); if (webappPath == null || !new File(webappPath).exists()) { LOGGER.error("Start error, No webapp files. root={}", webappPath); return; } StaticHandler webpageHandler = StaticHandler.create(); webpageHandler.setWebRoot(webappPath); LOGGER.info("server static web page for WEB_ROOT={}", webappPath); router.routeWithRegex(regex).failureHandler((context) -> { LOGGER.error("", context.failure()); }).handler(webpageHandler); } ··· java.lang.IllegalArgumentException: root cannot start with '/' at io.vertx.ext.web.handler.impl.StaticHandlerImpl.setRoot(StaticHandlerImpl.java:615) ~[vertx-web-3.8.3.jar!/:3.8.3] at io.vertx.ext.web.handler.impl.StaticHandlerImpl.setWebRoot(StaticHandlerImpl.java:478) ~[vertx-web-3.8.3.jar!/:3.8.3] at org.mec.website.StaticWebpageDispatcher.init(StaticWebpageDispatcher.java:29) ~[classes!/:1.0.0] at org.apache.servicecomb.transport.rest.vertx.RestServerVerticle.initDispatcher(RestServerVerticle.java:212) ~[transport-rest-vertx-2.0.0.jar!/:2.0.0] at org.apache.servicecomb.transport.rest.vertx.RestServerVerticle.start(RestServerVerticle.java:94) ~[transport-rest-vertx-2.0.0.jar!/:2.0.0] at io.vertx.core.Verticle.start(Verticle.java:66) ~[vertx-core-3.8.3.jar!/:3.8.3] at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$8(DeploymentManager.java:556) ~[vertx-core-3.8.3.jar!/:3.8.3] at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369) ~[vertx-core-3.8.3.jar!/:3.8.3] at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38) ~[vertx-core-3.8.3.jar!/:3.8.3] at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[netty-common-4.1.45.Final.jar!/:4.1.45.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[netty-common-4.1.45.Final.jar!/:4.1.45.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[netty-transport-4.1.45.Final.jar!/:4.1.45.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.45.Final.jar!/:4.1.45.Final] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.45.Final.jar!/:4.1.45.Final] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.45.Final.jar!/:4.1.45.Final]
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services