[JAXB-971] Regression: annotation @XmlJavaTypeAdapters on package is ignored since JAXB v2.2.4-1 Created: 26/Jul/13 Updated: 13/Jun/16
|Affects Version/s:||2.2.5, 2.2.6, 2.2.7|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
Windows 7 x64; JDK 1.6 and JDK 1.7
JAXB v2.2.4-1 was the last version that takes into account @XmlJavaTypeAdapters annotation (applied on package). All later JAXB versions ignore this annotation - supplied XmlAdapters are not being used.
Attached is an Ant project, adapted from JAXB sample "j2s-xmlAdapter".
The attached project has these modifications:
Running the attached project with JAXB v2.2.4-1 gives:
Running with JAXB v2.2.5, v2.2.6 and v2.2.7:
There is no difference, whether namespaces are being used or not. I stumbled on this bug working with WebServices and JAX-WS/JAXB bindings (where namespaces are being used).
Additionally, annotation @XmlJavaTypeAdapter is being ignored on classes too (though I do not have a sample test case).
It seems, that @XmlJavaTypeAdapter is being taken into account only when it is applied on class fields.
|Comment by donatasc [ 26/Jul/13 ]|
Sample project can be downloaded from:
|Comment by Iaroslav Savytskyi [ 29/Jul/13 ]|
Thanks a lot for reporting.
May be this problem occurred because of APT rewrite in 2.2.5. I have to check.
|Comment by matejsp [ 13/Jun/16 ]|
I have the same problem. Any chance of this bug being actually fixed?
Alternative would be to set package-info or set annotation on type class (in this case LinkedHashMap).