使用版本4.0.8的karaf制作一个jax-rs客户端时遇到了麻烦。一切都在使用旧的karaf(在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>
堆栈跟踪:
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
答案 0 :(得分:1)
如https://issues.apache.org/jira/browse/ARIES-1540和https://issues.apache.org/jira/browse/CXF-7183所述,CXF Blueprint命名空间与blueprint-core 1.7.x不兼容。
尝试更新您正在使用的cxf版本。请尝试3.1.10,3.0.13,3.2.0或更高版本。
<div class="input-group">
<input mdInput [mdDatepicker]="datepickerFrom" [max]="endDate" (click)="datepickerFrom.open()" (keydown)="false">
<button mdSuffix [mdDatepickerToggle]="datepickerFrom"></button>
<md-datepicker #datepickerFrom [startAt]="startDate" (selectedChanged)="onSelectStartDate($event)"></md-datepicker>
</div
<div class="input-group">
<input mdInput [mdDatepicker]="datepickerEnd" [min]="startDate" [disabled]="true" [max]="endDate" (click)="datepickerEnd.open()" (keydown)="false">
<button class="input-group-addon" [mdDatepickerToggle]="datepickerEnd"></button>
<md-datepicker #datepickerEnd [startAt]="startDate" (selectedChanged)="onSelectEndDate($event)"></md-datepicker>
</div>
不要忘记检查已部署的CXF版本是否也是3.1.10,3.0.13,3.2.0或更高版本。您可以点按功能:列表|你的karaf命令行中的grep cxf 。