NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ
for more details.
I wanted to compare how JiBX
stacks against JAXB in terms of performance. From their website, they claim "It also provides very high performance, outperforming all other Java data binding tools across a wide variety of tests."
. This sounded great, especially since I've identified that JAXB is a bottleneck
. I downloaded JiBX 1.2.6 and proceeded to generate my bindings, only to find that it could not handle my schema.
The error I kept on getting was java.lang.IllegalStateException: Internal error - type definition not found
. With verbose output enabled, this is what JiBX CodeGen output...
After some research, I found a post
that pretty much described the issue that I was seeing. Unfortunately I could not find any ways around this without having to spend a significant effort to modify the schema.
Expanding on the post I found, this is what the schema layout looks like (arrows show import or include). I created this image using twopi
tools from Graph Viz
The circular dependencies are quite clear.
The only schema that I could successfully generate bindings for was NarrativeBlock.xsd
, this is because it's a leaf node in the overall schema layout without any other includes/imports. Every single other XSD failed with the same exception.
It's a shame that JiBX can't handle this kind of schema layout, but then the HL7/CDA schema is not the best example of good schema design either.
Hope you found this post useful...
...so please read on! I love writing articles that provide beneficial information,
tips and examples to my readers. All information on my blog is provided free of
charge and I encourage you to share it as you wish. There is a small favour I ask in return however -
engage in comments below, provide feedback, and if you see mistakes let me know.
If you want to show additional support and help me pay for web hosting and
domain name registration,
donations, no matter how small, are always welcome!
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...