2016-04-04 18 views
3

私は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* 
+0

cxf-rt-transports-http-jetty jarsをクラスパスから除外してバージョンの不一致を修正しました。 –

答えて

3

をあなたはそれの必要な部分は、クラスパス上にない場合でも、桟橋を自動設定しようとする春ブーツでa bugをヒットしています。このバグはSpring Boot 1.2.7.RELEASEで修正されました。あなたはあなたが使っているバージョンは言っていませんが、それよりも早いと思います。最新バージョンにアップグレードすると、問題が解決されるはずです。最新のバージョンは1.3.3.RELEASEです。

+0

私は1.3.6を使用していますが、これはまだあります。 –

+0

@DurgaSwaroopそれはおそらく新しい質問で最もうまく対処している –

関連する問題