Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333505 - Namespace Issue with StaX and TypeMappingInfo
Summary: Namespace Issue with StaX and TypeMappingInfo
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-04 13:43 EST by Matt MacIvor CLA
Modified: 2022-06-09 10:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt MacIvor CLA 2011-01-04 13:43:25 EST
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.
Comment 1 Matt MacIvor CLA 2011-01-07 15:05:54 EST
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.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:36:05 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink