Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343424 - Error handing xml-binding level overrides if class isn't explicitly given to JAXBContextFactory
Summary: Error handing xml-binding level overrides if class isn't explicitly given to ...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-20 11:00 EDT by Denise Smith CLA
Modified: 2022-06-09 10:33 EDT (History)
1 user (show)

See Also:


Attachments
Proposed changes and test (19.13 KB, patch)
2011-05-04 09:22 EDT, Denise Smith CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Denise Smith CLA 2011-04-20 11:00:34 EDT
Assume the following bindings file

<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm">
    <xml-schema-types>
        <xml-schema-type name="int" type="java.math.BigDecimal" />
    </xml-schema-types>
    <xml-java-type-adapters>
        <xml-java-type-adapter value="testing.MyCalendarAdapter" type="testing.MyCalendar"/>
    </xml-java-type-adapters>
</xml-bindings>

If Employee has an Address and both Employee and Address should make use of the xml-schema-type and xml-java-type-adapter specified if we create the context like below then everything works fine

Class[] classes = new Class[]{Employee.class, Address.class};
JAXBContext ctx = JAXBContextFactory.createContext(classes, getProperties());

If the context is created without Address set then the xml-schema-type and xml-java-type-adapter are not used with it.  ie:
Class[] classes = new Class[]{Employee.class};
JAXBContext ctx = JAXBContextFactory.createContext(classes, getProperties());
Comment 1 Denise Smith CLA 2011-05-04 09:22:50 EDT
Created attachment 194711 [details]
Proposed changes and test
Comment 2 Denise Smith CLA 2011-05-04 14:58:47 EDT
Modifications to store the package level adapters during processing so they can be accessed later when processing the extra types that weren't part of the original classes array.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:33:35 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink