[JAXB-420] XJC ignores external bindings if xsd contains annotation at schema level and includes another schema Created: 17/Sep/07 Updated: 23/Jul/15 Resolved: 21/Jan/09
|Fix Version/s:||not determined|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
Operating System: All
The XJC compiler ignores any global bindings if my XSD contains an xs:annotation
File : included.xsd
File : po.xsd
<!-- Stock Keeping Unit, a code for identifying products -->
File 3: binding.xjb
With the <xs:annotation> element in po.xsd the orderDate instance variable in
protected XMLGregorianCalendar orderDate;
Without the <xs:annotation> element it is generated as...
protected DateTime orderDate;
Note that this does not happen if you only have one schema and it does not
|Comment by schubertf [ 17/Sep/07 ]|
Created an attachment (id=205)
|Comment by Pavel Bucek [ 21/Jan/09 ]|
already fixed in 2.1.10
|Comment by cristip32 [ 23/Jun/12 ]|
The problem is still present in 2.1.10
I found that com.sun.xml.internal.xsom.impl.SchemaImpl.setAnnotation() is called multiple times for the same SchemaImpl object. The XSAnnotation param for the first call contains the globalBindings and the next contains the schema-level documentation annotation, thus overwriting the global bindings.
|Comment by Martin Grebac [ 25/Jun/12 ]|
Hi, in case you can reproduce the failing case, would you please submit a reproducible testcase? Also, please verify with latest 2.2.x release.
|Comment by Stillglade [ 13/Feb/13 ]|
We also have been dealing with this issue for a long time. It is not just the path, but also the machine and JDK version. For example, I and another developer can have the exact same files in the same location using the same JDK version, but on one machine the binding file is picked up, and on the other it is ignored. Likewise, we have found that sometimes if you try a different JDK version, it will work or not work (there are some schemas where we have to run XJC with JDK 5 and others with JDK 6 to make it pick up the bindings file).
|Comment by schubertf [ 21/Apr/15 ]|
I raised this issue approx 8 years ago and have just encountered it again.
|Comment by Iaroslav Savytskyi [ 21/Apr/15 ]|
May be different OS? Ant/Maven version?
|Comment by luismcv [ 23/Jul/15 ]|
I was going crazy until I found this. I'm having the same issue.
I've been doing some tests and even just changing one single character of any of the directories in the path might change whether it ignores the bindings or not. For example, I try to build my project copying it under /tmp/build1 and it fails. If I rename the dir as build0 or build2, it works.
I made a script to test with "build" appended by different letters, but I can't see any obvious pattern:
And then again by appending different letters to the actual subproject's directory (two levels below /tmp/build/)