How do I deploy spring-boot WAR to Tomcat?

末鹿安然 提交于 2019-12-06 04:28:26

Ok, I have found the problem....Configuration!

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application
            .showBanner(true)
            .parent(Global.class)
            .child(applicationClass)
            .profiles("container")
            ;
}

should be ...

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application
            .showBanner(true)
            .parent(Global.class)
            .sources(applicationClass)
            .profiles("container")
            ;
}

... I used child() instead of sources()...

Thank you for your time!

Can you make your parent spring-boot-starter-parent?

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.1.9.RELEASE</version>
</parent>

Also you should make spring-boot-starter-tomcat provided

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>

If you link your whole POM or effective POM that may help

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!