首页 > 解决方案 > 嵌套模式中的 CXF 错误

问题描述

我有一个 cxf 配置文件和它使用的模式之一,使用我无权访问的其他模式。运行应用程序时出现错误

java.lang.RuntimeException: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from class path resource [cxf.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

我可能完全错了,但据我了解,问题出在 osgi 的模式上,它是 jaxrs 模式中使用的模式。

我的配置文件如下:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd">
 
<jaxrs:providers>
        <bean class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
            <property name="dropRootElement" value="true" />
            <property name="supportUnwrapped" value="true" />
        </bean>
</jaxrs:providers>
     
</beans>

有谁知道我该如何解决这个问题?

标签: javajax-rscxf

解决方案


推荐阅读