在pom文件中添加了undertow的依赖,并且屏蔽了tomcat。但是启动是,还是起的是tomcat。请各位大佬看看这是咋回事。
已找到原因,是因为我这个工程是由原来的SSM项目改造来的,使用了springBoot之后还是想用jsp,就引用了tomcat-embed-jasper包,导致容器一直是tomcat。
pom文件:
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.1.12.RELEASE
com.example
demo
0.0.1-SNAPSHOT
demo
Demo project for Spring Boot
1.8
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-tomcat
org.springframework.boot
spring-boot-starter-undertow
org.mybatis.spring.boot
mybatis-spring-boot-starter
2.1.1
org.mybatis.generator
mybatis-generator-core
1.3.2
mysql
mysql-connector-java
runtime
org.apache.tomcat.embed
tomcat-embed-jasper
org.springframework.boot
spring-boot-starter-test
test
org.junit.vintage
junit-vintage-engine
org.junit.jupiter
junit-jupiter-api
5.6.0
test
src/main/java
**/*.xml
**/*.properties
**/*.ftl
true
以下是maven依赖包
启动日志如下:
“C:\Program Files\Java\jdk1.8.0_221\bin\java.exe” -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true “-javaagent:C:\IDEA\IntelliJ IDEA 2019.3.3\lib\idea_rt.jar=49882:C:\IDEA\IntelliJ IDEA 2019.3.3\bin” -Dfile.encoding=UTF-8 -classpath “C:\Program Files\Java\jdk1.8.0_221\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\rt.jar;C:\Users\ASUS\IdeaProjects\demo\target\classes;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\boot\spring-boot-starter-web\2.1.12.RELEASE\spring-boot-starter-web-2.1.12.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\boot\spring-boot-starter\2.1.12.RELEASE\spring-boot-starter-2.1.12.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\boot\spring-boot\2.1.12.RELEASE\spring-boot-2.1.12.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\boot\spring-boot-autoconfigure\2.1.12.RELEASE\spring-boot-autoconfigure-2.1.12.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\boot\spring-boot-starter-logging\2.1.12.RELEASE\spring-boot-starter-logging-2.1.12.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\MYECLIPSE\Maven\mvnRespo\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\MYECLIPSE\Maven\mvnRespo\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;D:\MYECLIPSE\Maven\mvnRespo\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;D:\MYECLIPSE\Maven\mvnRespo\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;D:\MYECLIPSE\Maven\mvnRespo\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\MYECLIPSE\Maven\mvnRespo\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\boot\spring-boot-starter-json\2.1.12.RELEASE\spring-boot-starter-json-2.1.12.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\com\fasterxml\jackson\core\jackson-databind\2.9.10.2\jackson-databind-2.9.10.2.jar;D:\MYECLIPSE\Maven\mvnRespo\com\fasterxml\jackson\core\jackson-annotations\2.9.10\jackson-annotations-2.9.10.jar;D:\MYECLIPSE\Maven\mvnRespo\com\fasterxml\jackson\core\jackson-core\2.9.10\jackson-core-2.9.10.jar;D:\MYECLIPSE\Maven\mvnRespo\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.10\jackson-datatype-jdk8-2.9.10.jar;D:\MYECLIPSE\Maven\mvnRespo\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.10\jackson-datatype-jsr310-2.9.10.jar;D:\MYECLIPSE\Maven\mvnRespo\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.10\jackson-module-parameter-names-2.9.10.jar;D:\MYECLIPSE\Maven\mvnRespo\org\hibernate\validator\hibernate-validator\6.0.18.Final\hibernate-validator-6.0.18.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\org\jboss\logging\jboss-logging\3.3.3.Final\jboss-logging-3.3.3.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-web\5.1.13.RELEASE\spring-web-5.1.13.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-beans\5.1.13.RELEASE\spring-beans-5.1.13.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-webmvc\5.1.13.RELEASE\spring-webmvc-5.1.13.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-aop\5.1.13.RELEASE\spring-aop-5.1.13.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-context\5.1.13.RELEASE\spring-context-5.1.13.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-expression\5.1.13.RELEASE\spring-expression-5.1.13.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\boot\spring-boot-starter-undertow\2.1.12.RELEASE\spring-boot-starter-undertow-2.1.12.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\io\undertow\undertow-core\2.0.29.Final\undertow-core-2.0.29.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\org\jboss\xnio\xnio-api\3.3.8.Final\xnio-api-3.3.8.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\org\jboss\xnio\xnio-nio\3.3.8.Final\xnio-nio-3.3.8.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\io\undertow\undertow-servlet\2.0.29.Final\undertow-servlet-2.0.29.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\org\jboss\spec\javax\annotation\jboss-annotations-api_1.2_spec\1.0.2.Final\jboss-annotations-api_1.2_spec-1.0.2.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\io\undertow\undertow-websockets-jsr\2.0.29.Final\undertow-websockets-jsr-2.0.29.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\org\jboss\spec\javax\websocket\jboss-websocket-api_1.1_spec\1.1.4.Final\jboss-websocket-api_1.1_spec-1.1.4.Final.jar;D:\MYECLIPSE\Maven\mvnRespo\javax\servlet\javax.servlet-api\4.0.1\javax.servlet-api-4.0.1.jar;D:\MYECLIPSE\Maven\mvnRespo\org\glassfish\javax.el\3.0.0\javax.el-3.0.0.jar;D:\MYECLIPSE\Maven\mvnRespo\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.1.1\mybatis-spring-boot-starter-2.1.1.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\boot\spring-boot-starter-jdbc\2.1.12.RELEASE\spring-boot-starter-jdbc-2.1.12.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-jdbc\5.1.13.RELEASE\spring-jdbc-5.1.13.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-tx\5.1.13.RELEASE\spring-tx-5.1.13.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.1.1\mybatis-spring-boot-autoconfigure-2.1.1.jar;D:\MYECLIPSE\Maven\mvnRespo\org\mybatis\mybatis\3.5.3\mybatis-3.5.3.jar;D:\MYECLIPSE\Maven\mvnRespo\org\mybatis\mybatis-spring\2.0.3\mybatis-spring-2.0.3.jar;D:\MYECLIPSE\Maven\mvnRespo\org\mybatis\generator\mybatis-generator-core\1.3.2\mybatis-generator-core-1.3.2.jar;D:\MYECLIPSE\Maven\mvnRespo\mysql\mysql-connector-java\8.0.19\mysql-connector-java-8.0.19.jar;D:\MYECLIPSE\Maven\mvnRespo\org\apache\tomcat\embed\tomcat-embed-jasper\9.0.30\tomcat-embed-jasper-9.0.30.jar;D:\MYECLIPSE\Maven\mvnRespo\org\apache\tomcat\embed\tomcat-embed-core\9.0.30\tomcat-embed-core-9.0.30.jar;D:\MYECLIPSE\Maven\mvnRespo\org\apache\tomcat\tomcat-annotations-api\9.0.30\tomcat-annotations-api-9.0.30.jar;D:\MYECLIPSE\Maven\mvnRespo\org\apache\tomcat\embed\tomcat-embed-el\9.0.30\tomcat-embed-el-9.0.30.jar;D:\MYECLIPSE\Maven\mvnRespo\org\eclipse\jdt\ecj\3.18.0\ecj-3.18.0.jar;D:\MYECLIPSE\Maven\mvnRespo\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-core\5.1.13.RELEASE\spring-core-5.1.13.RELEASE.jar;D:\MYECLIPSE\Maven\mvnRespo\org\springframework\spring-jcl\5.1.13.RELEASE\spring-jcl-5.1.13.RELEASE.jar” com.example.DemoApplication
. ____ _ __ _ _
/\ / ’ __ _ () __ __ _ \ \ \
( ( )__ | '_ | '| | ’ / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
’ || .__|| ||| |__, | / / / /
=|_|======|/=////
:: Spring Boot :: (v2.1.12.RELEASE)
2020-03-06 11:16:06.391 INFO 11720 — [ main] com.example.DemoApplication : Starting DemoApplication on chensheng with PID 11720 (C:\Users\ASUS\IdeaProjects\demo\target\classes started by ASUS in C:\Users\ASUS\IdeaProjects\demo)
2020-03-06 11:16:06.394 INFO 11720 — [ main] com.example.DemoApplication : No active profile set, falling back to default profiles: default
2020-03-06 11:16:08.248 INFO 11720 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-03-06 11:16:08.282 INFO 11720 — [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-03-06 11:16:08.282 INFO 11720 — [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.30]
2020-03-06 11:16:08.290 INFO 11720 — [ main] o.a.catalina.core.AprLifecycleListener : An older version [1.2.14] of the APR based Apache Tomcat Native library is installed, while Tomcat recommends a minimum version of [1.2.23]
2020-03-06 11:16:08.291 INFO 11720 — [ main] o.a.catalina.core.AprLifecycleListener : Loaded APR based Apache Tomcat Native library [1.2.14] using APR version [1.6.2].
2020-03-06 11:16:08.291 INFO 11720 — [ main] o.a.catalina.core.AprLifecycleListener : APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2020-03-06 11:16:08.291 INFO 11720 — [ main] o.a.catalina.core.AprLifecycleListener : APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
2020-03-06 11:16:09.364 INFO 11720 — [ main] o.a.catalina.core.AprLifecycleListener : OpenSSL successfully initialized [OpenSSL 1.0.2l 25 May 2017]
2020-03-06 11:16:09.789 INFO 11720 — [ main] org.apache.jasper.servlet.TldScanner : At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2020-03-06 11:16:09.799 INFO 11720 — [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-03-06 11:16:09.800 INFO 11720 — [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3345 ms
2020-03-06 11:16:10.340 INFO 11720 — [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService ‘applicationTaskExecutor’
2020-03-06 11:16:10.629 INFO 11720 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ‘’
2020-03-06 11:16:10.631 INFO 11720 — [ main] com.example.DemoApplication : Started DemoApplication in 4.76 seconds (JVM running for 6.145)
Process finished with exit code -1