Project

General

Profile

Story #7832

migrate from JibX to JAXB for XML binding / codegen

Added by Rob Nahf over 7 years ago. Updated about 6 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
d1_common_java
Target version:
-
Start date:
2016-06-24
Due date:
% Done:

30%

Story Points:
Sprint:

Description

JibX is losing support in the community - not finding willing partners for maintainance - while JAXB has become the standard XML binding framework for Java. We plan to migrate / switch to JAXB for object un/marshalling and most likely datatype code generation.


Subtasks

Task #7833: compare JAXB generated class files to current classesClosedRob Nahf

Task #7834: develop maven configurationRejected

Task #7836: refactor JiBXException out of TypeMarshaller methodsClosedRob Nahf

Task #7844: support deep-copy cloning of service typesClosedRob Nahf

Task #7845: create marshaling adapters to handle malformed (empty) listsClosedRob Nahf

Task #7846: set up types to use JAXB, add JAXB logic to TypeMarshallerClosedRob Nahf

Task #7852: compare performance vs JibXClosedRob Nahf

Task #7910: schema validation behaviorNewRob Nahf


Related issues

Related to Infrastructure - Bug #7282: Can't build d1_common_java under java 1.8 Closed 2015-07-29

Associated revisions

Revision 18281
Added by Rob Nahf over 7 years ago

refs: #7832: Removed jibx and BCEL dependencies, now that JAXB has been benchmarked against JiBX favorably. Refactored TypeSmaplesTestCase to use the TypeMarshaller, instead of JiBX classes.

Revision 18320
Added by Rob Nahf over 7 years ago

refs #7832: removed outdated JiBX configurations files. Added 2.0.1 schema files and configurations for schema validation in the TypeMarshaller. Added validateAgainstSchema method for efficient validation (used in Sync)

History

#1 Updated by Rob Nahf over 7 years ago

  • Related to Bug #7282: Can't build d1_common_java under java 1.8 added

#2 Updated by Rob Nahf over 7 years ago

basic marshalling will create an empty type (no values set) that we've determined is problematic when unmarshalling, for example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

if using schema code generation, we would have to add special handling to get desired behavior (throwing an exception).

(see #7745)

#3 Updated by Rob Nahf over 7 years ago

standard xjc annotations are not getting all of the properties in our classes from the schema, for example, Checksum is only catching the "value" field, not the "algorithm" field.

#4 Updated by Rob Nahf over 7 years ago

xjc did not generate classes for 4 types in dataoneTypes.xsd:

1) ObjectFormatIdentifier
2) MonitorInfo
3) MonitorList
4) DescribeResponse

Were these ever JiBX code generated?

ObjectFormatIDentifier could probably be because it was declared a simpleType instead of a complexType. (Or could it be that the class name is so looooooooong. :-) )

#5 Updated by Rob Nahf over 7 years ago

Was able to get the TypeMarshallerTestCase to pass on a JAXB-based TypeMarshaller class (refactored from the JiBX-based on in d1_common_java), and with JAXB annotated copies of existing service.type classes.

  • need to make sure package-info.java is in the types package
  • need to make sure the @XMLRootElement(name = "lowerCaseClassName")
  • make sure the List element properties use the un-list name for the property, i.e.: List subject, instead of List<Subject subjectList

Still need to adapt all of the types with XMLAnnotations...
Still need to verify that Dates marshall correctly
Still need to verify that lists become lists...

#6 Updated by Rob Nahf over 7 years ago

Finished conversion from JibX to JAXB, using only a cache for the marshalling contexts as recommended. Caching the Marshallers and unmarsahllers themselves was tested, but didn't lead to a performance gain, so that code was removed. (The complication of adding ThreadLocals to make the TypeMarshaller thread safe was the primary consideration against leaving it in.

Removed JibX and BCEL configurations from pom.xml, as well as d1-jibx-extensions as a project dependency.

#7 Updated by Dave Vieglais about 6 years ago

  • Sprint set to CCI-2.3.8

#8 Updated by Dave Vieglais about 6 years ago

  • % Done changed from 0 to 30
  • Status changed from New to In Progress

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)