Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347958 - Parametrized values annotated with XmlElement throw IndexOutOfBoundsException
Summary: Parametrized values annotated with XmlElement throw IndexOutOfBoundsException
Status: CLOSED DUPLICATE of bug 340898
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-01 11:11 EDT by Nick Dunn CLA
Modified: 2022-06-09 10:21 EDT (History)
3 users (show)

See Also:


Attachments
This is the class that causes the problem. (1.33 KB, application/octet-stream)
2011-06-01 11:12 EDT, Nick Dunn CLA
no flags Details
Stack trace (2.33 KB, text/plain)
2011-06-01 11:13 EDT, Nick Dunn CLA
no flags Details
Standard JAXB implementation's serialization (633 bytes, text/plain)
2011-06-01 11:15 EDT, Nick Dunn CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Dunn CLA 2011-06-01 11:11:32 EDT
Build Identifier: 20090619-0625 

I attempted to use a ListWrapper object, as raw lists are not serialized correctly by JAXB (as per http://stackoverflow.com/questions/1603404/using-jaxb-to-unmarshal-marshal-a-liststring ).  When the object in question has a parametrized type (ListWrapper<T>), the JaxbContext fails to initialize.  When the wrapper is concrete and does not have type parameters, things work as expected.

Reproducible: Always

Steps to Reproduce:
1. Create a class that has type parameter <E> and which contains a List similarly parametrized (List<E>)
2. Attempt to create a new JAXBContext using this class as one of the elements passed in
3. Get a long stack trace about IndexOutOfBoundsException
Comment 1 Nick Dunn CLA 2011-06-01 11:12:36 EDT
Created attachment 197098 [details]
This is the class that causes the problem.

This is the class that causes the problem.
Comment 2 Nick Dunn CLA 2011-06-01 11:13:25 EDT
Created attachment 197099 [details]
Stack trace

Here is the stack trace
Comment 3 Nick Dunn CLA 2011-06-01 11:15:44 EDT
Created attachment 197101 [details]
Standard JAXB implementation's serialization

When using the standard JAXBContextFactory rather than moxy's, the class is serialized fine.
Comment 4 Blaise Doughan CLA 2011-06-01 12:53:06 EDT
This issue has already been fixed in the EclipseLink 2.3.0 stream (which is currently at release candidate 3).  A nightly download can be obtained here:

- http://www.eclipse.org/eclipselink/downloads/nightly.php

If you cannot upgrade or require the fix on a previous version please re-open the bug, and include the required version.

*** This bug has been marked as a duplicate of bug 340898 ***
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:21:12 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink