eclipse 从 WSDL 生成的自顶向下 Java 服务中 CXF 3.0.3 中的部署错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28091364/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 22:21:10  来源:igfitidea点击:

Deployment error in CXF 3.0.3 in generated top down Java service from WSDL

javaeclipsesoaptomcat7cxf

提问by sari

I would very much appreciate your help with this issue.

我非常感谢您对这个问题的帮助。

Configuration is Eclipse Juno, CXF 3.0.3 runtime and Tomcat v7. I have used CXF to create Web service top down from ready WSDL approach. But when deploying service on Tomcat I get the following error:

配置为 Eclipse Juno、CXF 3.0.3 运行时和 Tomcat v7。我已经使用 CXF 从准备好的 WSDL 方法自上而下地创建 Web 服务。但是在Tomcat上部署服务时出现以下错误:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/cxf/cxf-extension-soap.xml]

Offending resource: ServletContext resource [/WEB-INF/cxf-beans.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/cxf/cxf-extension-soap.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-soap.xml] cannot be opened because it does not exist

违规资源:ServletContext 资源 [/WEB-INF/cxf-beans.xml];嵌套异常是 org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/cxf/cxf-extension-soap.xml]; 嵌套异常是 java.io.FileNotFoundException: 类路径资源 [META-INF/cxf/cxf-extension-soap.xml] 无法打开,因为它不存在

I simple cannot find a solution to this error and I'm stuck for long time. Many thanks!

我只是找不到解决此错误的方法,而且我被困了很长时间。非常感谢!

回答by Diansheng

in WebContent/WEB-INF/cxf-beans.xml, remove import

在 WebContent/WEB-INF/cxf-beans.xml 中,删除导入

<import resource="classpath:META-INF/ cxf/ cxf-extension-soap.xml" />

回答by Konstantin V. Salikhov

According to documentationyou don't need to import this file anymore in CXF 3:

根据文档,您不再需要在 CXF 3 中导入此文件:

Starting in CXF 2.4.0, the extensions are loaded internally by CXF automatically and you do not need to import all the cxf-extension-*.xml file. You only need to import classpath:META-INF/cxf/cxf.xml.

从 CXF 2.4.0 开始,扩展由 CXF 自动在内部加载,您无需导入所有 cxf-extension-*.xml 文件。你只需要导入classpath:META-INF/cxf/cxf.xml。

回答by Thushan Jayasundara

I got the same issue with updating cxf 2.2.6 to 3.1.0. I just removed import cxf-extension-soap.xml and it worked.

我在将 cxf 2.2.6 更新到 3.1.0 时遇到了同样的问题。我刚刚删除了 import cxf-extension-soap.xml 并且它起作用了。