gpt4 book ai didi

rest - 2.4.0 中的 Apache CXF RS 扩展问题

转载 作者:行者123 更新时间:2023-12-03 13:52:07 25 4
gpt4 key购买 nike

我正在使用 Apache CXF 2.4.0 版。我正在尝试创建一个 Restful 服务。

下面的示例适用于 2.3.4,但不适用于 2.4.0。我应该在 bean 配置文件中做些什么不同的事情?

当我在我的 bean 配置文件中包含以下 xml 行时。

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

我收到以下堆栈跟踪错误:

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

Offending resource: ServletContext resource [/WEB-INF/beans.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException:

IOException parsing XML document from class path resource [META-INF/cxf/cxf-extension-jaxrs-binding.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-jaxrs-binding.xml] cannot be opened because it does not exist at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)



我的 POM 依赖项如下。这适用于 2.3.4,但不适用于 2.4.0。有什么建议么?该 xml 扩展行是否已弃用或包含在另一个 jar 中?
    <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>2.3.4</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</exclusion>
</exclusions>
</dependency>

最佳答案

它不再需要了。在 2.4.x 中,大部分 META-INF/cxf 文件不再需要并且可以删除。实际上,cxf.xml 是唯一需要的。

关于rest - 2.4.0 中的 Apache CXF RS 扩展问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6349424/

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