troubleshoot JAXB "chameleon schema" Errors
843833Jul 8 2009 — edited Jul 8 2009I am trying to use xjc from JAXB 2.1 to generate Java code for the HL7 CDA R2 format. Unfortunately, there appears to be errors in XML Schema files and so xjc fails with this exception.
The XML Schema files can be downloaded from http://xreg2.nist.gov/cda-validation/downloads/archives/HITSP_C37_TestPackage_03Jan_2008.zip.There are total 7 Schema files, and their names are: LabCDA.xsd, LabPOCD_MT000040.xsd, TF_Vol3_Lab.xsd, datatypes.xsd, datatypes-base.xsd, NarrativeBlock.xsd and voc.xsd. The relationship of the Schema files are complex: LabCDA.xsd is the top level Schema and includes LabPOCD_MT000040.xsd; LabPOCD_MT000040.xsd incluedes datatypes.xsd, NarrativeBlock.xsd and voc.xsd and imports TF_Vol3_Lab.xsd; TF_Vol3_Lab.xsd incluedes datatypes.xsd; datatypes.xsd incluedes datatypes-base.xsd; datatypes-base.xsd includes voc.xsd; voc.xsd includes datatypes.xsd.
[ERROR] (Relevant to above error) another "AdxpPostBox" is generated from here.
line 1158 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] (Relevant to above error) This confusing error happened most likely because the schema uses a technique called "
chameleon schema", which causes a single definition to be loaded multiple times into different namespaces. See http://fo
rums.java.net/jive/thread.jspa?threadID=18631 for more about this.
line 1158 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] A class/interface with the same name "test.jaxb.labreport.cda.ADXP" is already in use. Use a class customization
to resolve this conflict.
line 950 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] (Relevant to above error) another "ADXP" is generated from here.
line 950 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] (Relevant to above error) This confusing error happened most likely because the schema uses a technique called "
chameleon schema", which causes a single definition to be loaded multiple times into different namespaces. See http://fo
rums.java.net/jive/thread.jspa?threadID=18631 for more about this.
line 950 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] A class/interface with the same name "test.jaxb.labreport.cda.AdxpDeliveryInstallationArea" is already in use. U
se a class customization to resolve this conflict.
line 1123 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] (Relevant to above error) another "AdxpDeliveryInstallationArea" is generated from here.
line 1123 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] (Relevant to above error) This confusing error happened most likely because the schema uses a technique called "
chameleon schema", which causes a single definition to be loaded multiple times into different namespaces. See http://fo
rums.java.net/jive/thread.jspa?threadID=18631 for more about this.
line 1123 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] A class/interface with the same name "test.jaxb.labreport.cda.EnFamily" is already in use. Use a class customiza
tion to resolve this conflict.
line 1288 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] (Relevant to above error) another "EnFamily" is generated from here.
line 1288 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] (Relevant to above error) This confusing error happened most likely because the schema uses a technique called "
chameleon schema", which causes a single definition to be loaded multiple times into different namespaces. See http://fo
rums.java.net/jive/thread.jspa?threadID=18631 for more about this.
line 1288 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1048 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] (Related to above error) This is the other declaration.
line 1048 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes-base.xsd
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 694 of file:/F:/rcp_workspace/testCreate/processable/coreschemas/datatypes.xsd
I have referred http://forums.java.net/jive/thread.jspa?messageID=278619 and http://forums.java.net/jive/thread.jspa?threadID=18631, and solved id problem, but Unfortunately I don't know how to deal with the errors above.So I am looking help at here.
Edited by: wangxf_2000 on Jul 7, 2009 10:10 PM