gpt4 book ai didi

java - 部署 WAR 时,glassfish 找不到我的 wsdl

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:29:14 24 4
gpt4 key购买 nike

我有一个 CXF 服务,我首先创建了 WSDL,当我将 WAR 部署到 glassfish 应用程序服务器 2.1.1 时,出现以下异常:

java.io.FileNotFoundException: C:\Sun\AppServer\domains\domain1\config\TestService.wsdl

如果我将 WSDL 放在该位置,则一切正常。如何设置我的 WAR 以便将 TestService.wsdl 放入配置文件夹?

谢谢!

更新:我在将此服务部署到 Glassfish 时仍然遇到问题。它在 Tomcat 中部署并运行良好。

我在构建期间将 -wsdlLocation 属性设置为“WEB-INF/wsdl/TestService.wsdl”,但现在当我在 glassifish 中部署应用程序时,我在 server.log 中得到以下异常

[#|2010-02-01T10:47:06.164-0500|SEVERE|sun-        
appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=23;_ThreadName=Thread-
501;_RequestID=d3a3f49b-9329-477d-b6fc-24e0f4e4f3fa;|wsdl file
file:/C:/development/wexlink/FileUploadService/wsdl/FileUploadService.wsdl does not
exist for web service FileUploadService|#]

[#|2010-02-01T10:47:06.977-0500|SEVERE|sun
appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=23;_ThreadName=Thread-
501;_RequestID=d3a3f49b-9329-477d-b6fc-24e0f4e4f3fa;|Exception occured in J2EEC
Phasejava.lang.RuntimeException: wsdl file
file:/C:/development/wexlink/FileUploadService/wsdl/FileUploadService.wsdl does not
exist for web service FileUploadService
com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading deployment
descriptors for module [FileUploadService] -- wsdl file
file:/C:/development/wexlink/FileUploadService/wsdl/FileUploadService.wsdl does not
exist for web service FileUploadService
at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:406)
at com.sun.enterprise.deployment.backend.ModuleDeployer.loadDescriptors(ModuleDeployer.java:426)
at com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModuleDeployer.java:160)
at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:182)
at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:208)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:283)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835)
at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:225)

Caused by: java.lang.RuntimeException: wsdl 文件 file:/C:/development/wexlink/FileUploadService/wsdl/FileUploadService.wsdl 对于 web 服务 FileUploadService 不存在 在 com.sun.enterprise.deployment.util.ModuleContentValidator.accept(ModuleContentValidator.java:187) 在 com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1410) 在 com.sun.enterprise.deployment.archivist.WebArchivist.postOpen(WebArchivist.java:171) 在 com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:215) 在 com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:813) 在 com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:794) 在 com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:365) ... 还有 10 个|#]

最佳答案

通常,您会把它放在 WEB-INF 的某个地方。然后,当您使用 wsdl2java 或 maven 插件生成代码时,您使用 WEB-INF/TestService.wsdl 或类似文件传入一个 -wsdlLocation 标志,以便在代码中生成 get。

也就是说,使用 CXF,在您的 jaxws:endpoint 配置中,您可以使用 jaxws:endpoint 上的属性覆盖 wsdlLocation,以指定类似“WEB-INF/TestService.wsdl”的内容。

关于java - 部署 WAR 时,glassfish 找不到我的 wsdl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2102269/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com