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

Bug 345453

Summary: JAXB 2.2 is will not work with Java 1.6 by default - some facet validation is needed
Product: [WebTools] Dali JPA Tools Reporter: Neil Hauge <neil.hauge>
Component: JAXBAssignee: Paul Fullbright <paul.fullbright>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: kaloyan, tranle1
Version: 3.0Flags: neil.hauge: pmc_approved? (david_williams)
neil.hauge: pmc_approved? (raghunathan.srinivasan)
neil.hauge: pmc_approved? (naci.dai)
neil.hauge: pmc_approved? (deboer)
neil.hauge: pmc_approved? (neil.hauge)
kaloyan: pmc_approved+
neil.hauge: pmc_approved? (cbridgha)
neil.hauge: review+
Target Milestone: 3.0 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard: PMC_approved
Attachments:
Description Flags
proposed patch
none
updated patch
none
updated patch none

Description Neil Hauge CLA 2011-05-11 11:45:54 EDT
The 1.6 JRE currently ships JAXB 2.1 and as a result you cannot simply use JAXB 2.2 in an application without first using an endorsed jar mechanism to override the libraries in rt.jar.  

See - https://jaxb.dev.java.net/guide/Migrating_JAXB_2_0_applications_to_JavaSE_6.html#Using_JAXB_2_1_or_JAXB_2_2_with_JavaSE_6

As a result, we need to either restrict or warn users about this incompatibility when selecting facet versions.  My thought is that we should have a strongly worded warning when selecting JAXB 2.2 with Java 1.6. Such as:

"This facet configuration requires additional JRE configuration to work properly.  The JAXB API contained in this JRE must be manually overridden with the JAXB 2.2 API via an endorsement mechanism of your choice."
Comment 1 Paul Fullbright CLA 2011-05-11 20:49:49 EDT
Created attachment 195451 [details]
proposed patch
Comment 2 Paul Fullbright CLA 2011-05-12 00:17:10 EDT
Created attachment 195456 [details]
updated patch
Comment 3 Paul Fullbright CLA 2011-05-12 00:22:51 EDT
Created attachment 195457 [details]
updated patch
Comment 4 Neil Hauge CLA 2011-05-12 01:18:09 EDT
    * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

It is currently very easy for a user to end up with an invalid JAXB configuration that won't work correct in design-time or run-time.  This will cause a large amount of confusion for anyone using the JAXB defaults.

    * Is there a work-around? If so, why do you believe the work-around is insufficient? 

The workaround is to know that a given combination of facet versions are incompatible, and as a result avoid these configurations.

    * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

The fix has been tested by Paul and myself.  We have gone through all of the scenarios manually to insure that the code displays validation where necessary and doesn't show any unwanted validation errors.

    * Give a brief technical overview. Who has reviewed this fix?

This patch adds some basic validation to the JAXB facet configuration.  It also changes the default JAXB version to 2.1 which will work nicely with Java 1.6. The logic is straightforward.  I have reviewed the fix.

    * What is the risk associated with this fix? 

The risk is low-medium for this fix as it involved adding validation.  That said, the severity of the issue and the amount of testing done should mitigate the associated risk.  If we can get this into RC1 there will be time to fix if something comes up.
Comment 5 Paul Fullbright CLA 2011-05-12 10:52:44 EDT
committed for rc1