Affects Version/s: 2.2.7
Fix Version/s: None
The original Jira
JAXB-289 proposed a solution to fix the substitution resulting in rather inconvenient JAXBElement<T> used when the type was abstract and part of a substitution group. Also the documentation at https://jaxb.java.net/2.2.7/docs/ch05.html#substitutable suggests that this feature should work.
However it does not seem to work with JAXB-RI 2.2.7 anymore.
I have attached the original test files from
JAXB-289 as simple maven project using the maven-jaxb22-plugin. The project contains a default profile to show the output that is undesirable. You can run and inspect using following maven command:
The profile substitutable will just trigger a generation using the annotated schema as per documentation and the Jira issue. You can run this build with following maven command:
The exact stack trace error is: