本文介绍了使用Eclipse,GlassFish和Apache CXF的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用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上发布应用程序时,我不断收到此错误:

I am using Eclipse Juno v4.2 R2, an eclipse-internal GlassFish 3.1.2 (had the same problem with 3.1.2.2 before) and Apache CXF 2.7.1, trying to implement RESTful web services via JAX-RS. While the GlassFish server was starting up and deployment of the application was successful, the application cannot be deployed anymore since I restarted the IDE. When Eclipse tried to publish the application on GlassFish, I keep getting this error:

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

有人知道导致此错误的原因吗?

Does anyone know what is causing this error?

推荐答案

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

So far my solution to this problem has been to follow the suggestion found here: http://osdir.com/ml/users-cxf-apache/2012-12/msg00046.html

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

I've moved the following JARs from the CXF lib/ directory:

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

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

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

Then I've refreshed the CXF library on the build path tab of the Eclipse project (Remove the library then add it again, check that there are no cxf-services-ws-discovery-* and cxf-services-wsn-* JARs).

借助此新的CXF JAR,可以创建和部署客户端和服务工作.我刚刚在CXF 2.7.4中进行了尝试(CXF 2.7.5在Eclipse 4.2中存在更大的问题... Java2Ws立即停止...)

With this new CXF JARs creation and deployment of both client and service work. I've just tried it with CXF 2.7.4 (CXF 2.7.5 has even bigger problems with Eclipse 4.2... Java2Ws stops immediately...)

这篇关于使用Eclipse,GlassFish和Apache CXF的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 18:42