When using Tomcat to start the war package, it reports Not running on Jetty, JSR-356 support unavailable error + vue project published in tomcat

WAR package is started in TOMCAT, and the above error is reported

Comment out JETTY related dependencies

<!--        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jetty</artifactId>
            <scope>${jetty.scope}</scope>
        </dependency>-->

Report the following error

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean

View dependencies:

Found that TOCMAT related dependencies are exclusion

Comment out

        <!-- spring-boot使用jetty容器配置begin -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Run again and start successfully


Package the vue project with npm run build, copy the packaged directory to the static directory of the springboot project, and then publish the entire war to tomcat

 


Why should springboot be published to tomcat? ?

 

Guess you like

Origin blog.csdn.net/qq_24271537/article/details/114891939