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

时间:2016-06-30 07:27:55

标签: java maven cxf wildfly

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

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$1.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$1.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$1.run(UndertowDeploymentService.java:82)
    ... 6 more

我的网络模块的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>

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

1 个答案:

答案 0 :(得分:0)

试试这个

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