SpringBoot启动报错:NoClassDefFoundError: org/apache/juli/logging/LogFactory

SpringBoot在运行的时候会出现NoClassDefFoundError: org/apache/juli/logging/LogFactory的错误,具体错误内容如下:



  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.3.RELEASE)


2018-05-01 18:29:22.340  INFO 8092 --- [           main] com.itmayiedu.App                        : Starting App on XTZ-01803282120 with PID 8092 (G:\workspace\springboot-redis\target\classes started by Administrator in G:\workspace\springboot-redis)
2018-05-01 18:29:22.343  INFO 8092 --- [           main] com.itmayiedu.App                        : No active profile set, falling back to default profiles: default
2018-05-01 18:29:22.392  INFO 8092 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2880cac9: startup date [Tue May 01 18:29:22 CST 2018]; root of context hierarchy
2018-05-01 18:29:22.832  INFO 8092 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2018-05-01 18:29:23.236  WARN 8092 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
2018-05-01 18:29:23.242 ERROR 8092 --- [           main] o.s.boot.SpringApplication               : Application startup failed


org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536) ~[spring-context-4.3.8.RELEASE.jar:4.3.8.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
at com.itmayiedu.App.main(App.java:10) [classes/:na]
Caused by: java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.apache.catalina.util.LifecycleBase.<clinit>(LifecycleBase.java:37) ~[tomcat-embed-core-7.0.59.jar:7.0.59]
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:169) ~[spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.3.RELEASE.jar:1.5.3.RELEASE]
... 8 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200) ~[na:1.6.0_13]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_13]
at java.net.URLClassLoader.findClass(URLClassLoader.java:188) ~[na:1.6.0_13]
at java.lang.ClassLoader.loadClass(ClassLoader.java:307) ~[na:1.6.0_13]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) ~[na:1.6.0_13]
at java.lang.ClassLoader.loadClass(ClassLoader.java:252) ~[na:1.6.0_13]
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ~[na:1.6.0_13]

... 12 common frames omitted


这是因为没有juli.jar导致的,在pom.xml中加入

    <dependency>  
        <groupId>org.apache.tomcat.embed</groupId>  
        <artifactId>tomcat-embed-logging-juli</artifactId>  
        <version>7.0.27</version>  

</dependency> 

重新启动后问题解决。。。

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

07-31

在用ireport做报表时,出现如下错误rnjava.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactoryrn at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:95)rn at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147)rn at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:57)rn at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)rn at net.sf.jasperreports.engine.JasperRunManager.runReportToHtmlFile(JasperRunManager.java:441)rn at org.apache.jsp.ireportTest.ireportTest_jsp._jspService(org.apache.jsp.ireportTest.ireportTest_jsp:86)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Thread.java:619)rn怀疑是没有加commons-logging.jar,但是下了好几个版本,都不管用rn请高手指点啊。。。

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试