Error description:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:179)
at com.lyy.springboot.SpringBoot06DataMybatisApplication.main(SpringBoot06DataMybatisApplication.java:12)
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:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)...2 more
Copy the code
The reason for the error is lackcommons-logging.jarDownload commons-logging.jar from Maven’s central repository and import it into your Java project.
Warehouse Address:Mvnrepository.com/artifact/co…
Or download jar:commons.apache.org/proper/comm…