I have the following schemas and references to how they include each
other:

 

                            POCD_MT000040-modified.xsd

        |                                 |                           |

        v                                v                           v

datatypes.xsd     <----     voc.xsd           NarrativeBlock.xsd

                |                            ^

               v                             |

datatypes-base.xsd  --------------

 

In case that does not make sense:

 

POCD_MT000040-modified includes datatypes, voc, and NarrativeBlock;

datatypes includes datatypes-base

datatypes-base includes voc

voc includes datatypes

 

So there's a circular include.  All the includes are at the top of their
respective files. And are in the order listed above.

 

I ran codegen with the 1.2.2 version of JiBX and got an error about an
element missing.  It was defined in datatypes-base but used in voc.  I
got an error message for every time the missing element was used.

 

I figured that jibx did not load all the includes before beginning
processing.  I searched the archives and found a thread that discusses
this.  It suggests using the 1.2.3 code.  I did that and then received
the following error when I ran the codegen:

 

Output to directory C:\iknowmed\ApplicationServer\java

Loaded and validated 1 specified schema(s) and 4 referenced schema(s):

 top-level schema
C:\cygwin\home\klinel\CCD\Final\CDASchemas\cda\Schemas\POCD_MT000040-mod
ified.xsd

 referenced schema datatypes.xsd

 referenced schema datatypes-base.xsd

 referenced schema voc.xsd

 referenced schema NarrativeBlock.xsd

 

Exception in thread "main" java.lang.IllegalStateException: Internal
error - type definition not found

        at
org.jibx.schema.codegen.custom.ComponentExtension.replaceAndReference(Co
mponentExtension.java:393)

        at
org.jibx.schema.codegen.custom.ComponentExtension.applyAndCountUsage(Com
ponentExtension.java:612)

        at
org.jibx.schema.codegen.custom.ComponentExtension.applyAndCountUsage(Com
ponentExtension.java:723)

        at
org.jibx.schema.codegen.CodeGen.processExtensions(CodeGen.java:436)

        at
org.jibx.schema.codegen.CodeGen.applyAndNormalize(CodeGen.java:460)

        at org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1734)

        at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:2203)

 

This seems better in that it recognizes all of the schemas.

 

So I tried changing the order of the includes.  In
POCD_MT000040-modified I placed voc first.  Then I got the following:

 

Output to directory C:\iknowmed\ApplicationServer\java

Loaded and validated 1 specified schema(s) and 4 referenced schema(s):

 top-level schema
C:\cygwin\home\klinel\CCD\Final\CDASchemas\cda\Schemas\POCD_MT000040-mod
ified.xsd

 referenced schema voc.xsd

 referenced schema datatypes.xsd

 referenced schema datatypes-base.xsd

 referenced schema NarrativeBlock.xsd

 

Exception in thread "main" java.lang.IllegalStateException: Internal
error - invalid list type

        at
org.jibx.schema.codegen.StructureClassHolder.addRepeatedProperty(Structu
reClassHolder.java:1000)

        at
org.jibx.schema.codegen.StructureClassHolder.addToClass(StructureClassHo
lder.java:1484)

        at
org.jibx.schema.codegen.StructureClassHolder.addToClass(StructureClassHo
lder.java:1477)

        at
org.jibx.schema.codegen.StructureClassHolder.addToClass(StructureClassHo
lder.java:1477)

        at
org.jibx.schema.codegen.StructureClassHolder.generate(StructureClassHold
er.java:2147)

        at
org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:210)

        at
org.jibx.schema.codegen.PackageHolder.generate(PackageHolder.java:227)

        at
org.jibx.schema.codegen.CodeGen.buildDataModel(CodeGen.java:1573)

        at org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1780)

        at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:2203)

 

So I'm still blocked on this.  Any suggestions other than rewriting the
schemas?  They are from a third part and I am loathe to rewrite them as
that could invalidate our conformance to their specification.

 

BTW, I was able to use JAXB on these schemas successfully.  It generated
the classes anyway.  I'm hoping that JiBX will generate classes that are
easier to use however.

 

TIA,

 

Larry

 

 

P.S. I'm not including the schemas because they are huge.

</pre>The contents of this electronic mail message and any attachments are 
confidential, possibly privileged and intended for the addressee(s) 
only.<br>Only the addressee(s) may read, disseminate, retain or otherwise use 
this message. If received in error, please immediately inform the sender and 
then delete this message without disclosing its contents to anyone.</pre>
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to