我正在尝试让 hyperjaxb 处理真实的模式。我从此链接下载并解压缩了 hyperjaxb maven 项目,然后导航到根目录cmd.exe
,并使用示例数据通过运行mvn clean install
对其进行测试,以确保它适用于示例模式。然后,我将 、 和 文件替换schema.xsd
为po.xml
实际bindings.xjb
图形的精简版本,以便我可以准备通过上面链接的 hyperjaxb 项目运行真正的应用程序。然后我又跑mvn clean install
了。但是,我收到以下错误消息:
[ERROR] Error while parsing schema(s).Location
[ file:/C:/path/to/src/main/resources/bindings.xjb{25,53}].
com.sun.istack.SAXParseException2; systemId:
file:/C:/path/to/src/main/resources/bindings.xjb; lineNumber: 25; columnNumber: 53;
XPath evaluation of "xs:complexType[@name='Any']" results in empty target node
从您可以在此链接中阅读的替换bindings.xjb
文件中。
使用此链接上的文件,以及您可以在此链接上阅读的文件。 schema.xsd
po.xml
bindings.xjb 的相关部分是:
<jaxb:bindings node="xs:complexType[@name='Any']">
<hj:entity>
<orm:table name="any"/>
</hj:entity>
</jaxb:bindings>
ANY
schema.xsd 中 complexType 的定义为:
<xs:complexType name="ANY"><!-- abstract="true">-->
<xs:annotation>
<xs:documentation>
Some documentation.
</xs:documentation>
</xs:annotation>
<xs:attribute name="nullFlavor" type="NullFlavor" use="optional">
<xs:annotation>
<xs:documentation>
Some other documentation.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
请注意,完整的代码在上面的链接中。 如何解决此错误?