2017-03-01 127 views
1

我有cxf的spring-boot應用程序。當我運行它,我得到一個異常:Cxf + Spring引導(org.apache.cxf.bus.extension.ExtensionException)

[2017.03.01 17:37:35.839 MSK] [DEBUG] [o.a.c.c.s.ConfigurerImpl] [main] 
[Could not determine bean name for instance of class org.apache.cxf.wsdl11.WSDLManagerImpl.] 
[2017.03.01 17:37:35.841 MSK] [DEBUG] [o.a.c.r.DefaultResourceManager] 
[main] [resolving resource <org.apache.cxf.wsdl11.WSDLManagerImpl/bus> type <interface org.apache.cxf.Bus>] 
[2017.03.01 17:37:35.842 MSK] [DEBUG] [o.a.c.r.DefaultResourceManager] 
[main] [resolving resource <null> type <interface org.apache.cxf.Bus>] 
[2017.03.01 17:37:35.870 MSK] [DEBUG] [o.a.c.b.e.Extension] [main] [Could not load optional extension org.apache.cxf.binding.xml.wsdl11.XMLWSDLExtensionLoader] 

org.apache.cxf.bus.extension.ExtensionException: Could not create object of extension class org.apache.cxf.binding.xml.wsdl11.XMLWSDLExtensionLoader. 
    at org.apache.cxf.bus.extension.Extension.load(Extension.java:241) 
    at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:213) 
    at org.apache.cxf.bus.extension.ExtensionManagerImpl.getBeansOfType(ExtensionManagerImpl.java:348) 
    at org.apache.cxf.bus.spring.SpringBeanLocator.getBeansOfType(SpringBeanLocator.java:153) 
    at org.apache.cxf.wsdl11.WSDLManagerImpl.setBus(WSDLManagerImpl.java:122) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426) 

跳過一些行和

CXF的
Caused by: java.lang.NegativeArraySizeException: null 
    at org.objectweb.asm.Frame.a(Unknown Source) 
    at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 

依賴性和春季啓動

<dependency> 
    <groupId>org.apache.cxf</groupId> 
    <artifactId>cxf-rt-databinding-jaxb</artifactId> 
    <version>${cxf.version}</version> 
    </dependency> 
    <dependency> 
    <groupId>org.apache.cxf</groupId> 
    <artifactId>cxf-rt-management</artifactId> 
    <version>${cxf.version}</version> 
    </dependency> 
    <dependency> 
    <groupId>org.apache.cxf</groupId> 
    <artifactId>cxf-spring-boot-starter-jaxws</artifactId> 
    <version>${cxf.version}</version> 
    </dependency> 
    <dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-web-services</artifactId> 
</dependency> 

春季啓動 - 1.4.1 CXF - 3.1.7

請幫忙!!我怎樣才能找到一個錯誤?

+0

您可以在這裏添加cxf配置嗎?第一個和最後一個依賴項是可選的 –

+0

看起來你的項目中存在一些jar衝突。你只需要' org.apache.cxf CXF-RT-前端-JAXWS $ {} cxf.version org.apache.cxf CXF-RT-運輸 - http-hc $ {cxf.version} '對於cxf jaxws。 –

回答

0

看來你的項目中有多個asm依賴關係。您可以通過從根項目執行mvn dependency:tree或在項目構建後查看工件來查找它們。 對於與CXF 3.x一起使用,您應該具有依賴關係org.ow2.asm:asm:jar:5.x.x和更高版本。

希望有所幫助。