Only support tomcat?I used undertow
See original GitHub issuethis my pom.xml
<dependencies>
<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.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
docker run
root@nasoft-virtual-machine:/usr/local/tools# docker logs -f 5a42c2075b9a
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:179)
at org.orh.Application.main(Application.java:13)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more
If it is tomcat, no problem.
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (10 by maintainers)
Top Results From Across the Web
Spring Boot and Embedded Servers - Tomcat, Jetty and ...
We will discuss the different options that Spring Boot supports - Tomcat, Jetty and Undertow. Image. You will learn. What is an embedded...
Read more >76. Embedded Web Servers - Spring
76.6 Enable HTTP Response Compression. HTTP response compression is supported by Jetty, Tomcat, and Undertow. It can be enabled in application.properties , as ......
Read more >Spring Boot Embedded Servers - Tomcat, Jetty and Undertow
Spring Boot includes support for embedded Tomcat, Jetty, and Undertow servers. Most developers use the appropriate “Starter” to obtain a fully configured ...
Read more >java - Replacing tomcat with undertow server for spring-boot ...
I'm trying to setup a simple spring-boot example project (keycloak tutorial) but I'm stuck at a startup error. The only thing that differs...
Read more >Undertow May Be Better for SpringBoot than Tomcat - Medium
According to the StackShare community, Apache Tomcat has a broader approval ... SrpingBoot has completely inherited the Undertow technology, we only need to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @qq12157138, The reason is in your class the
docker-maven-plugin
depend on thespring-boot-maven-plugin
and there are some differences in the dependencies processing betweenspring-boot-maven-plugin
withjib-maven-plugin
. I tested onspring-boot-maven-plugin
by markingprovided
tojava-servlet-api
, however, when I runspring-boot:repackage
thejava-servlet-api
still include in the final jar file, that is why thedocker-maven-plugin
run successfully.@d5nguyenvan @qq12157138 you can run Jib twice to tag your image with different names: #654. Jib is optimized and will skip building images in this case.
@coollog looks like the “provided” dependency issue is not uncommon with Spring Boot-based WAR applications, e.g. #640. That makes sense, as a normal WAR expects that the Servlet APIs and a Servlet engine are provided and not part of the WAR.