Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363949

Summary: Namespaces on XmlElementRef marshalled incorrectly
Product: z_Archived Reporter: Rick Barkhouse <rick.barkhouse>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: blaise.doughan
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test Case reproducing the error
none
Patch - code changes
none
Patch - test changes
none
Additional Patch none

Description Rick Barkhouse CLA 2011-11-16 13:25:49 EST
If an @XmlElementRef declares its own namespace, we are not marshalling the corresponding element's namespace information correctly.

public class EchoByteArray {

    @XmlElementRef(name = "request", namespace = "http://missing-uri.org/", type = JAXBElement.class, required = false)
    protected JAXBElement<byte[]> request;

}

This class will get marshalled as:

<?xml version="1.0" encoding="UTF-8"?>
<EchoByteArray xmlns:ns0="http://missing-uri.org/">
   <request>AAECBAg=</ns0:request>
</EchoByteArray>

Note 'ns0' on the closing tag, but not the opening tag.
Comment 1 Rick Barkhouse CLA 2011-11-16 13:27:53 EST
Created attachment 207105 [details]
Test Case reproducing the error
Comment 2 Rick Barkhouse CLA 2011-11-16 14:46:25 EST
Seems related to the byte[] -- element is marshalled correctly if it is JAXBElement<String>
Comment 3 Rick Barkhouse CLA 2011-11-17 12:34:41 EST
Created attachment 207161 [details]
Patch - code changes
Comment 4 Rick Barkhouse CLA 2011-11-17 12:35:02 EST
Created attachment 207162 [details]
Patch - test changes
Comment 5 Rick Barkhouse CLA 2011-11-17 14:32:54 EST
Fixed in trunk and 2.3.
Comment 6 Rick Barkhouse CLA 2011-11-18 13:04:05 EST
Reopening is there is an additional problem.
Comment 7 Rick Barkhouse CLA 2011-11-18 13:09:25 EST
Created attachment 207239 [details]
Additional Patch
Comment 8 Rick Barkhouse CLA 2011-11-18 13:51:15 EST
Fixed in trunk and 2.3.
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:19:38 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink