gpt4 book ai didi

Java、Alfresco Web 服务 API 和 Unicode NamedValues

转载 作者:行者123 更新时间:2023-11-30 09:58:57 25 4
gpt4 key购买 nike

我使用 Java 访问 Alfresco 内容服务器,通过它的 Web 服务 API 将一些内容导入其中。内容应将一些 NamedValue 属性设置为 UTF-8(西里尔字母)字符串。我一直收到 Sax 解析器异常:

org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1b) was found in the element content of the document.

代码看起来像这样:

NamedValue[] namedValueProperties = new NamedValue[2];

namedValueProperties[0] = Utils.createNamedValue(Constants.PROP_NAME, name );
namedValueProperties[1] = Utils.createNamedValue("{my.custom.model}myProperty", cyrillicString);

CMLCreate create = new CMLCreate("1", parentReference, null, null, null, documentType, namedValueProperties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
UpdateResult[] results = null;

try {
results = WebServiceFactory.getRepositoryService().update(cml);
} catch (...)
Here comes the "org.xml.sax.SAXParseException"
}

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

最佳答案

问题是我使用的 alfresco-web-service-client.jar 库来自 2.9B 发行版(我正在访问 2.9B 社区内容服务器)和依赖库 bcprov- jdk15-136.jarxmlsec-1.4.0.jar 不够用(从 2.1 版本开始就很旧)。我应该使用与 2.9B 分发一起部署的 bcprov-jdk15-137.jarxmlsec-1.4.1.jar

关于Java、Alfresco Web 服务 API 和 Unicode NamedValues,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/190542/

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