Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363949 - Namespaces on XmlElementRef marshalled incorrectly
Summary: Namespaces on XmlElementRef marshalled incorrectly
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-11-16 13:25 EST by Rick Barkhouse CLA
Modified: 2022-06-09 10:19 EDT (History)
1 user (show)

See Also:


Attachments
Test Case reproducing the error (1.29 KB, application/x-zip-compressed)
2011-11-16 13:27 EST, Rick Barkhouse CLA
no flags Details
Patch - code changes (1.49 KB, patch)
2011-11-17 12:34 EST, Rick Barkhouse CLA
no flags Details | Diff
Patch - test changes (8.80 KB, patch)
2011-11-17 12:35 EST, Rick Barkhouse CLA
no flags Details | Diff
Additional Patch (3.41 KB, patch)
2011-11-18 13:09 EST, Rick Barkhouse CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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