错误:java.lang.ClassCastException:class org.apache.cxf.bus.spring.SpringBusFactory

时间:2011-09-01 18:05:02

标签: java web-services osgi webclient cxf

西洛!

我正在尝试使用CXF创建Web服务客户端。我的申请是在OSGi。我使用Felix框架。

但发生以下错误:

[main] ERROR org.apache.cxf.BusFactory - Failed to determine BusFactory implementation class name.
java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
    at java.lang.Class.asSubclass(Unknown Source)
    at org.apache.cxf.BusFactory.getBusFactoryClass(BusFactory.java:280)
    at org.apache.cxf.BusFactory.newInstance(BusFactory.java:207)
    at org.apache.cxf.BusFactory.newInstance(BusFactory.java:194)
    at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:90)
    at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:137)
    at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:122)
    at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:89)
    at javax.xml.ws.Service.<init>(Service.java:36)
    at myorg.engine.test.mocks.soapservice.client.CHMService.<init>(CHMService.java:42)
    at myorg.engine.service.OSGiServiceTest.testSoapServiceMock(OSGiServiceTest.java:133)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.injectContextAndInvoke(ProbeInvokerImpl.java:112)
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.findAndInvoke(ProbeInvokerImpl.java:71)
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.call(ProbeInvokerImpl.java:58)
    at org.ops4j.pax.exam.nat.internal.NativeTestContainer.call(NativeTestContainer.java:83)
    at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.invoke(EagerSingleStagedReactor.java:85)
    at org.ops4j.pax.exam.junit.JUnit4TestRunner$2.evaluate(JUnit4TestRunner.java:259)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.ops4j.pax.exam.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:86)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

[main] ERROR org.apache.cxf.BusFactory - Failed to instantiate bus factory.
java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
    at java.lang.Class.asSubclass(Unknown Source)
    at org.apache.cxf.BusFactory.newInstance(BusFactory.java:218)
    at org.apache.cxf.BusFactory.newInstance(BusFactory.java:194)
    at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:90)
    at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:137)
    at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:122)
    at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:89)
    at javax.xml.ws.Service.<init>(Service.java:36)
    at myorg.engine.test.mocks.soapservice.client.CHMService.<init>(CHMService.java:42)
    at myorg.engine.service.OSGiServiceTest.testSoapServiceMock(OSGiServiceTest.java:133)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.injectContextAndInvoke(ProbeInvokerImpl.java:112)
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.findAndInvoke(ProbeInvokerImpl.java:71)
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.call(ProbeInvokerImpl.java:58)
    at org.ops4j.pax.exam.nat.internal.NativeTestContainer.call(NativeTestContainer.java:83)
    at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.invoke(EagerSingleStagedReactor.java:85)
    at org.ops4j.pax.exam.junit.JUnit4TestRunner$2.evaluate(JUnit4TestRunner.java:259)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.ops4j.pax.exam.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:86)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
[org.ops4j.pax.exam.junit.JUnit4TestRunner] : Exception
org.ops4j.pax.exam.TestContainerException: java.lang.reflect.InvocationTargetException
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.injectContextAndInvoke(ProbeInvokerImpl.java:118)
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.findAndInvoke(ProbeInvokerImpl.java:71)
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.call(ProbeInvokerImpl.java:58)
    at org.ops4j.pax.exam.nat.internal.NativeTestContainer.call(NativeTestContainer.java:83)
    at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.invoke(EagerSingleStagedReactor.java:85)
    at org.ops4j.pax.exam.junit.JUnit4TestRunner$2.evaluate(JUnit4TestRunner.java:259)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.ops4j.pax.exam.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:86)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.injectContextAndInvoke(ProbeInvokerImpl.java:112)
    ... 20 more

Caused by: java.lang.RuntimeException: java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
    at org.apache.cxf.BusFactory.newInstance(BusFactory.java:224)
    at org.apache.cxf.BusFactory.newInstance(BusFactory.java:194)
    at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:90)
    at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:137)
    at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:122)
    at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:89)
    at javax.xml.ws.Service.<init>(Service.java:36)
    at myorg.engine.test.mocks.soapservice.client.CHMService.<init>(CHMService.java:42)
    at myorg.engine.service.OSGiServiceTest.testSoapServiceMock(OSGiServiceTest.java:133)
    ... 25 more

Caused by: java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
    at java.lang.Class.asSubclass(Unknown Source)
    at org.apache.cxf.BusFactory.newInstance(BusFactory.java:218)
    ... 33 more

[main] ERROR org.apache.cxf.BusFactory - Failed to determine BusFactory implementation class name. java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory at java.lang.Class.asSubclass(Unknown Source) at org.apache.cxf.BusFactory.getBusFactoryClass(BusFactory.java:280) at org.apache.cxf.BusFactory.newInstance(BusFactory.java:207) at org.apache.cxf.BusFactory.newInstance(BusFactory.java:194) at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:90) at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:137) at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:122) at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:89) at javax.xml.ws.Service.<init>(Service.java:36) at myorg.engine.test.mocks.soapservice.client.CHMService.<init>(CHMService.java:42) at myorg.engine.service.OSGiServiceTest.testSoapServiceMock(OSGiServiceTest.java:133) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.injectContextAndInvoke(ProbeInvokerImpl.java:112) at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.findAndInvoke(ProbeInvokerImpl.java:71) at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.call(ProbeInvokerImpl.java:58) at org.ops4j.pax.exam.nat.internal.NativeTestContainer.call(NativeTestContainer.java:83) at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.invoke(EagerSingleStagedReactor.java:85) at org.ops4j.pax.exam.junit.JUnit4TestRunner$2.evaluate(JUnit4TestRunner.java:259) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.ops4j.pax.exam.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:86) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) [main] ERROR org.apache.cxf.BusFactory - Failed to instantiate bus factory. java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory at java.lang.Class.asSubclass(Unknown Source) at org.apache.cxf.BusFactory.newInstance(BusFactory.java:218) at org.apache.cxf.BusFactory.newInstance(BusFactory.java:194) at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:90) at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:137) at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:122) at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:89) at javax.xml.ws.Service.<init>(Service.java:36) at myorg.engine.test.mocks.soapservice.client.CHMService.<init>(CHMService.java:42) at myorg.engine.service.OSGiServiceTest.testSoapServiceMock(OSGiServiceTest.java:133) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.injectContextAndInvoke(ProbeInvokerImpl.java:112) at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.findAndInvoke(ProbeInvokerImpl.java:71) at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.call(ProbeInvokerImpl.java:58) at org.ops4j.pax.exam.nat.internal.NativeTestContainer.call(NativeTestContainer.java:83) at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.invoke(EagerSingleStagedReactor.java:85) at org.ops4j.pax.exam.junit.JUnit4TestRunner$2.evaluate(JUnit4TestRunner.java:259) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.ops4j.pax.exam.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:86) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) [org.ops4j.pax.exam.junit.JUnit4TestRunner] : Exception org.ops4j.pax.exam.TestContainerException: java.lang.reflect.InvocationTargetException at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.injectContextAndInvoke(ProbeInvokerImpl.java:118) at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.findAndInvoke(ProbeInvokerImpl.java:71) at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.call(ProbeInvokerImpl.java:58) at org.ops4j.pax.exam.nat.internal.NativeTestContainer.call(NativeTestContainer.java:83) at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.invoke(EagerSingleStagedReactor.java:85) at org.ops4j.pax.exam.junit.JUnit4TestRunner$2.evaluate(JUnit4TestRunner.java:259) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.ops4j.pax.exam.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:86) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.ops4j.pax.exam.raw.extender.intern.ProbeInvokerImpl.injectContextAndInvoke(ProbeInvokerImpl.java:112) ... 20 more Caused by: java.lang.RuntimeException: java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory at org.apache.cxf.BusFactory.newInstance(BusFactory.java:224) at org.apache.cxf.BusFactory.newInstance(BusFactory.java:194) at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:90) at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:137) at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:122) at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:89) at javax.xml.ws.Service.<init>(Service.java:36) at myorg.engine.test.mocks.soapservice.client.CHMService.<init>(CHMService.java:42) at myorg.engine.service.OSGiServiceTest.testSoapServiceMock(OSGiServiceTest.java:133) ... 25 more Caused by: java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory at java.lang.Class.asSubclass(Unknown Source) at org.apache.cxf.BusFactory.newInstance(BusFactory.java:218) ... 33 more

我说这可能是因为不同的ClassLoader。有可能吗?

知道如何解决问题吗?

谢谢!

3 个答案:

答案 0 :(得分:0)

是的,看起来你有两个BusFactory类定义。 SpringBusFactory实现其中一个,而另一个调用asSubclass()。由于一个BusFactory与另一个BusFactory不是同一个类,因此您将获得一个CCE。查找包含BusFactory类的两个不同的包。其中一个将由定义SpringBusFactory的包导入。

答案 1 :(得分:0)

我认为“两个BusFactory类定义”是一个红色的鲱鱼。

不确定您正在使用的是哪个版本的CXF(猜测2.4.2),但该代码在查找子类实现时尝试使用线程上下文类加载器来执行ServiceLoader类型的东西。

我最好的猜测是CXF依赖的是一些Spring“魔法”而你错过了提供它的捆绑包。看看Karaf的CXF功能,它有很多依赖关系,检查一下并确保你已经完成了所有这些 - 在这一点上,使用安装了CXF功能的karaf可能更容易尝试这一点。

如果您正在使用maven,则可以使用以下方法访问功能文件:

    <dependency>
        <groupId>org.apache.cxf.karaf</groupId>
        <artifactId>apache-cxf</artifactId>
        <version>2.4.2</version>
        <type>xml</type>
        <classifier>features</classifier>
    </dependency>

有关总线配置的一些文档here

答案 2 :(得分:0)

我在过去看过像pax-exam那样的奇怪错误。这是否在“普通”OSGi环境中运行在pax-exam之外? Talend Service Factory(http://talend.com/products/tsf)有一些在OSGi中运行的CXF客户端和服务的示例(在单独的示例下载包中),它们都可以正常工作。