wildfly10:部署 cxf-rt-rs-extension-search 时出现 NoClassDefFoundError

wildfly10: NoClassDefFoundError on deployment for cxf-rt-rs-extension-search

我将 apache cxf-rt-rs-extension-search 添加到我的 pom.xml 并在部署到 wildfly 10 时获得以下堆栈跟踪。

09:08:07,503 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 159) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./mis2-web: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./mis2-web: java.lang.NoClassDefFoundError: Failed to link org/apache/cxf/jaxrs/ext/search/QueryContextProvider (Module "deployment.mis2-ear.ear.mis2-web.war:main" from Service Module Loader): org/apache/cxf/jaxrs/ext/ContextProvider
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.run(UndertowDeploymentService.java:85)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/cxf/jaxrs/ext/search/QueryContextProvider (Module "deployment.mis2-ear.ear.mis2-web.war:main" from Service Module Loader): org/apache/cxf/jaxrs/ext/ContextProvider
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:78)
    at org.jboss.modules.Module.loadModuleClass(Module.java:605)
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
    at org.jboss.resteasy.spi.ResteasyDeployment.registerProvider(ResteasyDeployment.java:546)
    at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:342)
    at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:245)
    at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113)
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
    at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
    at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
    at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
    at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:231)
    at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:132)
    at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:526)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.run(UndertowDeploymentService.java:82)
    ... 6 more

我的web模块的pom中的依赖如下:

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-rs-extension-search</artifactId>
    <version>3.1.4</version>
</dependency>

在我的耳模块的 pom 中,我添加了对 apache cxf 服务的依赖:

<archive>
    <manifestEntries>
        <ImplementationVersion>${project.version}</ImplementationVersion>
        <Dependencies>org.apache.cxf services</Dependencies>
    </manifestEntries>
</archive>

我做错了什么或者这里缺少了什么? 谢谢!

试试这个

<archive>
    <manifestEntries>
        <ImplementationVersion>${project.version}</ImplementationVersion>
        <Dependencies>org.apache.cxf</Dependencies>
    </manifestEntries>
</archive>