私はSpring起動アプリケーションを起動しようとしています。Spring起動アプリケーションの起動中にjettyサーバのNoClassDefFoundErrorを取得する
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*
cxf-rt-transports-http-jetty jarsをクラスパスから除外してバージョンの不一致を修正しました。 –