JAXB Ant任务错误:xjc2 [ERROR]空的未知位置

JAXB Ant任务错误:xjc2 [ERROR]空的未知位置,第1张

JAXB Ant任务错误:xjc2 [ERROR]空的未知位置

模式正确性检查

在使用XJC时,我们看到了一个类似的问题(请参阅下面的链接),该问题通过禁用模式正确性检查得以解决:

  • http://wiki.eclipse.org/Eclipselink/Examples/MOXy/Dynamic/JAXBContextFromXMLSchema

尝试使用以下系统属性来禁用架构正确性检查

-Dcom.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.noCorrectnessCheck=true

对于Ant,请尝试:

<xjc target="src">  <schema dir="src" includes="**debug.xsd"/>  <arg value="-nv" /></xjc>

从下一页开始,-nv参数与模式正确性检查有关:

  • http://fisheye5.atlassian.com/browse/~raw,r=1.1/jaxb/www/2.1-ea1/docs/xjcTask.html

进入守则

您可以尝试以编程方式与XJC进行交互(请参见下文),并插入自己的EntityResolver以查看导入/包含在哪里失败:

import com.sun.premodel.*;import com.sun.tools.xjc.*;import com.sun.tools.xjc.api.*;SchemaCompiler sc = XJC.createSchemaCompiler();sc.setEntityResolver(new YourEntityResolver());sc.setErrorListener(new YourErrorListener());sc.parseSchema(SYSTEM_ID, element);S2JJAXBModel model = sc.bind();


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/5489392.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-12
下一篇 2022-12-12

发表评论

登录后才能评论

评论列表(0条)

保存