2

我正在使用 Eclipse Juno v4.2 R2、一个 Eclipse 内部 GlassFish 3.1.2(之前与 3.1.2.2 有同样的问题)和 Apache CXF 2.7.1,试图通过 JAX-RS 实现 RESTful Web 服务。GlassFish 服务器正在启动并且应用程序部署成功时,由于我重新启动了 IDE,因此无法再部署该应用程序。当 Eclipse 尝试在 GlassFish 上发布应用程序时,我不断收到此错误:

Severe: wsdl file classpath:/org/apache/cxf/ws/discovery/wsdl/wsdd-discovery-1.1-wsdl-os.wsdl does not exist for web service Discovery
Severe: Exception while deploying the app [MyFunnyApp]
Severe: wsdl file classpath:/org/apache/cxf/ws/discovery/wsdl/wsdd-discovery-1.1-wsdl-os.wsdl does not exist for web service Discovery
java.lang.RuntimeException: wsdl file classpath:/org/apache/cxf/ws/discovery/wsdl/wsdd-discovery-1.1-wsdl-os.wsdl does not exist for web service Discovery
    at com.sun.enterprise.deployment.util.ModuleContentValidator.accept(ModuleContentValidator.java:196)
    at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1999)
    at com.sun.enterprise.deployment.archivist.WebArchivist.postOpen(WebArchivist.java:284)
    at com.sun.enterprise.deployment.archivist.WebArchivist.postOpen(WebArchivist.java:89)
    at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:245)
    at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:252)
    at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:213)
    at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:165)
    at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:185)
    at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:94)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:827)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:769)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
    at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:722)


Severe: Exception while deploying the app [MyFunnyApp] : wsdl file classpath:/org/apache/cxf/ws/discovery/wsdl/wsdd-discovery-1.1-wsdl-os.wsdl does not exist for web service Discovery

有谁知道是什么导致了这个错误?

4

1 回答 1

3

到目前为止,我对这个问题的解决方案是遵循这里的建议:http: //osdir.com/ml/users-cxf-apache/2012-12/msg00046.html

我已经从 CXF lib/ 目录中移动了以下 JAR:

cxf-services-ws-discovery-api-2.7.4.jar cxf-services-ws-discovery-service-2.7.4.jar cxf-services-wsn-api-2.7.4.jar cxf-services-wsn-core -2.7.4.jar

然后我在 Eclipse 项目的构建路径选项卡上刷新了 CXF 库(删除库然后重新添加,检查是否没有 cxf-services-ws-discovery-* 和 cxf-services-wsn-* JAR) .

使用这个新的 CXF JAR 创建和部署客户端和服务工作。我刚刚用 CXF 2.7.4 尝试过(CXF 2.7.5 与 Eclipse 4.2 有更大的问题...... Java2Ws 立即停止......)

于 2013-05-27T21:52:03.950 回答