当前位置: 首页 > 知识库问答 >
问题:

使用Eclipse、GlassFish和Apache CXF出现异常

乐正玺
2023-03-14

我正在使用Eclipse Juno V4.2R2,一个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

共有1个答案

柏阳炎
2023-03-14

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

我已经将以下JAR从CXF lib/目录中移出:

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

然后,我在Eclipse项目的build path选项卡上刷新了CXF库(删除库,然后再次添加它,检查是否没有cxf-services-ws-discovery-*和cxf-services-wsn-*JARs)。

使用这个新的CXF JAR,创建和部署客户机和服务工作。我刚刚在CXF2.7.4中尝试了它(CXF2.7.5在Eclipse 4.2中有更大的问题…Java2Ws立即停止…)

 类似资料:
  • 我是玻璃鱼的新手 异常[Eclipse链接-4002](Eclipse持久性服务-2.3.2. v20111125-r10461):org.eclipse.persistence.exceptions.数据库异常内部异常:java.sql.SQLExc0019:未选择数据库错误代码: 1046 在运行服务器之前,我确保服务器配置是使用以下指南完成的: mysql站点手册使用glassfish连接器

  • 我一直在忙着用angularjs前端构建一个REST应用程序,使用MAVEN jersey-quickstart-webapp,使用GLASSFISH WebServer在Eclipse上开发。今天当我开始在项目上做一些开发时,当我尝试在eclipse中启动服务器并部署webapp时,我得到了eclipse错误窗口中显示的以下错误消息: 需要注意的是,我并没有故意更改Eclipse或GlassFi

  • 我使用Eclipse IDE来处理servlet。我创建了一个maven项目来使用异步Servlet3.0,并为其添加了适当的依赖关系。代码返回true。现在,当我调用servlet时,它会给出以下错误 warn:oejs.servletHandler://testplugin/jsonServlet java.lang.IllegalStateException:dependated,初始地址为

  • 我是网络服务和玻璃鱼的新手。这是我的代码 如果我有 当我尝试部署web服务时,我得到以下错误。 无法部署TestGF部署失败=部署期间发生错误:加载应用程序时出现异常:java.lang.IllegalStateException:ContainerBase。addChild:开始:org.apache.catalina。LifecycleException:java.lang.RuntimeEx

  • 严重:加载应用程序信息时出现异常:file:/c:/users/administrateur/documents/netbeansprojects/gparc_v1.0/gparc-ear/target/gfdeploy/gparc-ear/gparc-ejb-1.0_jar/_gparc-ejbpu注销成功信息:[7]已删除ID为98894641828724736的计时器 严重:加载应用程序时出

  • 当我在日食中执行上述代码时。抛出以下错误。 线程“main”java.lang.NoClassDefFoundError中的异常:org/apache/hc/core5/http/ClassicHttpRequest at testcases.TestFindingElement.main(TestFindingElement.java:14)由:java.lang.ClassNotFoundEx