gpt4 book ai didi

spring-boot - 启动 Spring Boot 应用程序时,jetty 服务器出现 NoClassDefFoundError

转载 作者:行者123 更新时间:2023-12-01 19:24:55 24 4
gpt4 key购买 nike

我正在尝试启动 Spring Boot 应用程序。出现以下异常:

Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jettyEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedJetty.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory]: Factory method 'jettyEmbeddedServletContainerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at com.filinv.rtl.ei.ao.app.Application.main(Application.java:10)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jettyEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedJetty.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory]: Factory method 'jettyEmbeddedServletContainerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext

mvn 依赖:树

*+- org.apache.cxf:cxf-rt-transports-http:jar:3.0.0-milestone1:compile
[INFO] | \- org.apache.cxf:cxf-rt-transports-http-jetty:jar:3.0.0-milestone1:compile
[INFO] | +- org.eclipse.jetty:jetty-server:jar:9.2.11.v20150529:compile
[INFO] | | +- org.eclipse.jetty:jetty-http:jar:9.2.11.v20150529:compile
[INFO] | | | \- org.eclipse.jetty:jetty-util:jar:9.2.11.v20150529:compile
[INFO] | | \- org.eclipse.jetty:jetty-io:jar:9.2.11.v20150529:compile
[INFO] | +- org.eclipse.jetty:jetty-security:jar:9.2.11.v20150529:compile*

最佳答案

您正在点击a bug在 Spring Boot 中,它尝试自动配置 Jetty,即使它的必需部分不在类路径上。该错误已在 Spring Boot 1.2.7.RELEASE 中修复。您没有说您正在使用哪个版本,但我认为它比该版本更早。升级到最新版本应该可以解决您的问题。在撰写本文时,最新版本是 1.3.3.RELEASE。

关于spring-boot - 启动 Spring Boot 应用程序时,jetty 服务器出现 NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36395872/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com