Apache Axiom 1.3.0 Release Note
Changes in this release
-
Axiom now requires at least Java 7:
- Explicit dependencies on APIs that were not part of the JRE in Java 5 (Activation, StAX and JAXB) have been removed.
- The public API now uses generics. Note that this should in general not have impact on binary compatibility with Axiom 1.2.x.
-
In Axiom 1.2.x several APIs were using
Objectas argument/return type although they expect/return aDataHandler. This is a legacy of Axis 1.x where the Activation API was an optional dependency. This no longer makes sense:- In Java 6, the Activation API is part of the JRE.
- It is unlikely that Axiom actually works if the Activation API is not available: there is nothing in the build that enforces or tests that, and there are no known downstream projects that use Axiom without also depending on the Activation API.
In Axiom 1.3.0, the following APIs have been changed to use
DataHandlerinstead ofObject:OMText.getDataHandler()OMFactory.createOMText(Object, boolean)
Bridge methods have been added to ensure binary compatibility with Axiom 1.2.x.
-
By default, parsers created by Axiom are now non coalescing and have CDATA section reporting enabled.
-
The builder implementations and related classes have been removed from the
org.apache.axiom.om.impl.builderandorg.apache.axiom.soap.impl.builderpackages. This includes theStAXBuilder,StAXOMBuilder,XOPAwareStAXOMBuilder,StAXSOAPModelBuilderandMTOMStAXSOAPModelBuilderclasses.This change was necessary to enable a refactoring and complete overhaul of the builders.
As explained in the Axiom 1.2.11 release notes, application code should use the
OMXMLBuilderFactoryAPI to create builders. Code written for Axiom 1.2.x that uses that API remains compatible with Axiom 1.3.x. -
The
detachmethod no longer causes the node to be built. This change was made possible by the new builder design. -
Several methods have been removed from the
OMXMLParserWrapperinterface. This includes formerly deprecated methods as well as methods that would allow manipulation of the state of the underlying parser. -
The
BuilderAwareReaderAPI introduced by AXIOM-268 has been removed without replacement. There are multiple reasons for this:- The only method defined by the
BuilderAwareReaderinterface has a parameter of typeStAXBuilder, but that class has been removed from the public API (see above). The parameter type would have to be changed toOMXMLParserWrapper. - If the interface is considered a public API, then it is placed in the
wrong package (
org.apache.axiom.om.impl.builder). - There are no known usages of that API.
- The API is merely a convenience, but doesn't provide any additional
feature: since a builder only starts consuming the
XMLStreamReaderon demand, a reference to the builder can be injected into the custom “builder aware” reader after the builder has been created.
- The only method defined by the
-
Some (most? all?) of the classes in
axiom-compathave been removed. -
Support for the
SOAPConstants.SOAPBODY_FIRST_CHILD_ELEMENT_QNAMEproperty introduced by AXIOM-282 has been retired.
- The legacy behavior for
getChildrenWithNameimplemented by AXIOM-11 is no longer supported. In Axiom 1.3.0 the QName matching is always strict.
-
The legacy behavior for
declareNamesapce(where an empty prefix is interpreted in the same way as a null value) is no longer supported. See AXIOM-375. -
Elements no longer store line number information, and the corresponding methods on the
OMElementinterface have been deprecated. -
The
CustomBuilderandCustomBuilderSupportinterfaces have changed in an incompatible way. Note that this API was designed to enable some very specific optimizations in Axis2, so that this change should have limited impact.In addition to the interface changes, the API no longer gives access to the raw
XMLStreamReaderreturned by the StAX implementation. That feature was originally introduced to allow negotiation of additional optimizations between proprietary StAX and JAXB implementations from a particular vendor. That feature is no longer necessary and has been removed to allow a simplification of the builder design. -
In Axiom 1.2.x,
StAXUtilsby default kept per class loader maps ofXMLInputFactoryandXMLOutputFactoryinstances (where the key was the thread context class loader). These maps were implemented asWeakHashMap<ClassLoader,XMLInputFactory>andWeakHashMap<ClassLoader,XMLOutputFactory>. The problem with this approach is that it may cause a class loader leak if theXMLInputFactoryorXMLOutputFactoryinstance has a strong reference to theClassLoaderused as key. That case occurs in two scenarios:- A StAX implementation is loaded by a class loader that is neither the
class loader that loads StAXUtils nor one of its parent class loaders,
and that class loader is set as the context class loader when
StAXUtilsis used. Note that this is basically the use case for which the per class loader maps were originally designed. - For whatever reason, the
XMLInputFactory/XMLOutputFactoryinstance keeps a strong reference to the thread context class loader set when the instance was created. In that scenario, ifStAXUtilsis used with a thread context class loader that is set to any class loader other than the one that loadedStAXUtilsor one of its parents, thenStAXUtilswill prevent that class loader from being garbage collected. This type of behavior has been reported for the default StAX implementation in the Oracle JRE; Woodstox is probably not affected.
The scenario for which the per class loader feature was designed is probably very rare. As shown above, that scenario is always prone to class loader leaks. Therefore this feature has been removed without replacement in Axiom 1.3.0, and
StAXUtilsnow always loads the StAX implementation visible to its own class loader. Note that this mode was already supported in Axiom 1.2.x, but it was not the default. - A StAX implementation is loaded by a class loader that is neither the
class loader that loads StAXUtils nor one of its parent class loaders,
and that class loader is set as the context class loader when
-
The
getNodeValueandsetNodeValuemethods have been removed from theSOAPFaultNodeinterface because they conflict with methods defined by DOM'sNodeinterface. Note that these methods were already deprecated in Axiom 1.2.x, with alternative methods being available. -
The
SOAPFaultCodeimplementations for SOAP 1.2 no longer override thegetTextAsQNamemethod (which was an undocumented feature used by Axis2). Use thegetValueAsQNameto retrieve the fault code value in a version independent manner. -
In Axiom 1.2.x the
SOAPMessageandSOAPEnvelopeimplementations had special serialization logic, causing the serialization of aSOAPEnvelopeto emit an XML declaration by default and the serialization of aSOAPMessageto skip all content in the prolog and epilog. This behavior was completely undocumented and violates basic object oriented design principles: althoughSOAPMessageis anOMDocumentandSOAPEnvelopeis anOMElement, they didn't behave in the same way asOMDocumentandOMElementwhen it comes to serialization. This in turn led to an awkward design. This special serialization logic has been removed in Axiom 1.3 andSOAPMessageandSOAPEnvelopenow have the same behavior as any otherOMDocumentandOMElement. The main implication is that the serialization of aSOAPEnvelopeno longer generates an XML declaration. This change also fixes AXIOM-474. -
In Axiom 1.3.0, the
getBuildermethod always returnsnullfor document and elements that are (locally) complete, i.e. for which the end event has been processed. That means that after completion, nodes created by a builder will be indistinguishable from programmatically created nodes. -
The
OMXMLStreamReaderinterface has been removed because all if its usages were already deprecated in 1.2.x. -
Support for the legacy
XMLStreamReaderextension for optimized base64 handling has been removed. The only supported mechanism in Axiom 1.3.x is defined by theDataHandlerReaderAPI. -
The
MimePartProviderinterface has been moved toorg.apache.axiom.mime. -
The
MTOMXMLStreamWriterclass is now abstract. It is not meant to be instantiated by code outside of Axiom; the Javadoc of theOMDataSourceinterface describes the only supported interactions with theMTOMXMLStreamWriterAPI. -
The
XMLStreamWriterFilterAPI and the support for it inOMOutputFormatandMTOMXMLStreamWriterhave been removed. There are multiple reasons for this:-
Since
MTOMXMLStreamWriteris now an abstract class, it is possible to createMTOMXMLStreamWriterwrappers to achieve essentially the same result as installing anXMLStreamWriterFilteron anMTOMXMLStreamWriter. -
The API violated the API layering because
XMLStreamWriterFilterwas part of a utility package (org.apache.axiom.om.util), but used in the interface of a core API, namelyorg.apache.axiom.om.OMOutputFormat. -
An
XMLStreamWriterFilterspecified usingOMOutputFormatwas applied only when serializing to anOutputStream, but not to aWriterorXMLStreamWriter. -
The implementation had insufficient test coverage. In particular, the
setFilterandremoveFiltermethods inMTOMXMLStreamWriterhad no coverage at all. -
Since the same
XMLStreamWriterFilterinstance can't be used concurrently, the presence of a property of that type inOMOutputFormatmakes that class thread unsafe.
-
-
The
axiom-c14nartifact has been removed without replacement. Use DOOM together with Apache Santuario instead.


