Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
卡拉夫;jax-rs:名称空间属性&x27;http://cxf.apache.org/blueprint/jaxrs', 元素信息项的属性必须相同_Jax Rs_Karaf - Fatal编程技术网

卡拉夫;jax-rs:名称空间属性&x27;http://cxf.apache.org/blueprint/jaxrs', 元素信息项的属性必须相同

卡拉夫;jax-rs:名称空间属性&x27;http://cxf.apache.org/blueprint/jaxrs', 元素信息项的属性必须相同,jax-rs,karaf,Jax Rs,Karaf,我在使用karaf的4.0.8版本制作jax-rs客户机时遇到了一些问题。一切都在一个更老的卡拉夫上运行(在4.0.3上测试) 有什么想法吗 如何测试/复制: 只需使用blueprint.xml创建一个示例包 <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3

我在使用karaf的4.0.8版本制作jax-rs客户机时遇到了一些问题。一切都在一个更老的卡拉夫上运行(在4.0.3上测试)

有什么想法吗

如何测试/复制:

只需使用blueprint.xml创建一个示例包

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
           xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
           xmlns:jaxrs-client="http://cxf.apache.org/blueprint/jaxrs-client"
           xsi:schemaLocation="
  http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
  http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd
  http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
  http://cxf.apache.org/blueprint/jaxrs-client http://cxf.apache.org/schemas/blueprint/jaxrs-client.xsd
  ">


    <jaxrs-client:client id="testClient"
                  serviceClass="org.test..."
                  address="{url}">

    </jaxrs-client:client>
</blueprint>

Stacktrace:

org.xml.sax.SAXParseException: src-import.3.1: The namespace attribute, 'xxx://cxf.apache.org/blueprint/jaxrs', of an <import> element information item must be identical to the targetNamespace attribute, 'xxx://cxf.apache.org/jaxrs', of the imported document.

2017-06-26 14:58:40,024 | WARN  | nsole user karaf | NamespaceHandlerRegistryImpl     | 12 - org.apache.aries.blueprint.core - 1.7.1 | NamespaceHandler org.apache.cxf.jaxrs.client.blueprint.JAXRSBPNam espaceHandler is behaving badly and should be fixed
2017-06-26 14:58:40,041 | WARN  | nsole user karaf | NamespaceHandlerRegistryImpl     | 12 - org.apache.aries.blueprint.core - 1.7.1 | Unable to find namespace handler for ://cxf.apache.org/configuration/beans
2017-06-26 14:58:40,100 | WARN  | nsole user karaf | NamespaceHandlerRegistryImpl     | 12 - org.apache.aries.blueprint.core - 1.7.1 | Unable to find namespace handler for ://cxf.apache.org/blueprint/jaxrs
2017-06-26 14:58:40,123 | ERROR | nsole user karaf | BlueprintContainerImpl           | 12 - org.apache.aries.blueprint.core - 1.7.1 | Unable to start blueprint container for bundle /1.0.0.SNAPSHOT
org.xml.sax.SAXParseException: src-import.3.1: The namespace attribute, '://cxf.apache.org/blueprint/jaxrs', of an <import> element information item must be identical to the targetNamespace attribute, '://cxf.apache.org/jaxrs', of the imported document.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[:]
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)[:]
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)[:]
    at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknow
org.xml.sax.SAXParseException:src import.3.1:namespace属性,'xxx://cxf.apache.org/blueprint/jaxrs元素信息项的“”必须与targetNamespace属性“”相同xxx://cxf.apache.org/jaxrs“”的文件。
2017-06-26 14:58:40024 |警告| NSLE用户karaf | NamespaceHandlerRegistryImpl | 12-org.apache.aries.blueprint.core-1.7.1 | NamespaceHandler org.apache.cxf.jaxrs.client.blueprint.JAXRSBPNam-espaceHandler行为不正常,应予以修复
2017-06-26 14:58:40041 |警告| NSLE用户karaf | NamespaceHandlerRegistryImpl | 12-org.apache.aries.blueprint.core-1.7.1 |找不到://cxf.apache.org/configuration/beans的命名空间处理程序
2017-06-26 14:58:40100 |警告| NSLE用户karaf | NamespaceHandlerRegistryImpl | 12-org.apache.aries.blueprint.core-1.7.1 |找不到://cxf.apache.org/blueprint/jaxrs的命名空间处理程序
2017-06-26 14:58:40123 |错误| NSLE用户karaf | BlueprintContainerImpl | 12-org.apache.aries.blueprint.core-1.7.1 |无法启动捆绑包的blueprint容器/1.0.0.SNAPSHOT
org.xml.sax.SAXParseException:src import.3.1:元素信息项的命名空间属性“://cxf.apache.org/blueprint/jaxrs”必须与导入文档的targetNamespace属性“://cxf.apache.org/jaxrs”相同。
位于org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(未知源)[:]
在org.apache.xerces.util.ErrorHandlerWrapper.error(未知源)[:]
在org.apache.xerces.impl.XMLErrorReporter.reportError(未知源)[:]
位于org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(未知
如和中所述,CXF Blueprint命名空间与Blueprint core 1.7.x不兼容

请尝试更新您正在使用的cxf版本。请尝试3.1.10、3.0.13、3.2.0或更高版本

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-frontend-jaxrs</artifactId>
    <version>3.1.11 for example</version>
</dependency>

org.apache.cxf
cxf rt前端jaxrs
例如,3.1.11
别忘了检查CXF的部署版本是否也是3.1.10、3.0.13、3.2.0或更高版本。您可以在karaf命令行中点击功能:list | grep CXF