【问题标题】:Why Xsd Cannot Load a Transcoding Service?为什么 Xsd 无法加载转码服务?
【发布时间】:2017-08-25 18:38:28
【问题描述】:

我正在使用 CodeSynthesis XSD(用于 C++ 的 XML 数据绑定工具)从 .xsd 文件中自动生成 .hpp 和 .cpp 文件。但是在我的 .xsd 文件上运行 xsd 时,我收到了这个错误:

Could not load a transcoding service

我正在使用 openSUSE Leap-42.2、Xsd 4.0 和 Apache Xercess 3.1.4。以下是详细信息:

Scanning dependencies of target XSDModel
[  2%] Generating C++/XML mapping
Could not load a transcoding service
lib/CMakeFiles/XSDModel.dir/build.make:51: recipe for target 'src/model/Model.cpp' failed
make[2]: *** [src/model/Model.cpp] Error 255
CMakeFiles/Makefile2:76: recipe for target 'lib/CMakeFiles/XSDModel.dir/all' failed
make[1]: *** [lib/CMakeFiles/XSDModel.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
[  2%] Generating C++/XML mapping
Could not load a transcoding service
lib/CMakeFiles/XSDModel.dir/build.make:51: recipe for target 'src/model/Model.cpp' failed
make[2]: *** [src/model/Model.cpp] Error 255
CMakeFiles/Makefile2:76: recipe for target 'lib/CMakeFiles/XSDModel.dir/all' failed
make[1]: *** [lib/CMakeFiles/XSDModel.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

编辑 1: 我用--enable-transcoder-gnuiconvswitch 构建了Apache Xercess,并且iconv 也安装在我的机器上。

编辑 2: 经过一番挖掘,我发现我的 linux 上的 echo $LANG 命令打印了一个空行。另外,运行localedef -i en_US -f UTF-8 en_US.UTF-8会打印这个错误:

character map file `UTF-8' not found: No such file or directory
cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory

【问题讨论】:

    标签: c++ xsd transcoding codesynthesis


    【解决方案1】:

    在这个 linux 上没有定义语言环境。所以,只需设置一个语言环境:

    $ export LANG=en_US.UTF-8
    

    然后,一切都会好起来的。

    【讨论】:

    • 在一个旧的 centos5 docker 镜像上遇到了同样的问题:现在测试了这个并且可以完美运行,谢谢
    猜你喜欢
    • 2013-05-14
    • 1970-01-01
    • 2011-03-11
    • 2020-03-17
    • 2018-02-03
    • 1970-01-01
    • 1970-01-01
    • 2014-04-25
    • 1970-01-01
    相关资源
    最近更新 更多