繁体   English   中英

嵌入式tomcat容器未从应用程序属性获取上下文路径。(春季启动)

[英]Embedded tomcat container is not taking the context path from application properties.(Spring boot)

我正在为我的Web应用程序使用spring boot。 我在应用属性中为myApplication设置了上下文路径。 但是,当我运行我的应用程序时,嵌入式容器未设置上下文路径。

application.properties

server.context-path=/myApplication

oaccC[Tomcat].[localhost].[/](Here the context is missing) :初始化Spring嵌入式WebApplicationContext(运行容器时的日志)

这可能是什么原因?

尝试将其添加到您的配置中

    @Component
    public class CustomizationBean implements  EmbeddedServletContainerCustomizer {
     @Override
     public void customize(ConfigurableEmbeddedServletContainer container) 
       {    
            container.setPort(8083);
       }
     }

http://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-servlet-containers.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM