Community
Participate
Working Groups
Due to the order of processing, EclipseLink JAXB will sometimes use a defaultNamespace even when it shouldn't. If there are global elements with a namespace of "", then a defaultNamespace other than "" shouldn't be used. The processing to check for this however is done BEFORE global elements from TypeMappingInfo are created, so they aren't included in the check. This causes a problem when marshalling into an XMLStreamWriter or XMLEventWriter that already has a default namespace declared. EclipseLink will do special code to cancel out that declaration. However if this happens when the EclipseLink NamespaceResolver has a defaultNamespace, EclipseLink will try to declare the defaultNamespace twice on the same element which causes an exception.
Fix checked into main as of revision 8789 Reviewed by David McCann. Added a check for "" namespace on Root-Level elements defined on TypeMappingInfo objects. If there's a root element with "" namespace, then a default namespace of something other than "" should never be used.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink