Uploaded image for project: 'Stanbol'
  1. Stanbol
  2. STANBOL-1395

StAX 2 support in Stanbol

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.12.0
    • Fix Version/s: 1.0.0, 0.12.1
    • Component/s: Commons
    • Labels:
      None

      Description

      While using Jackson to generate XML by a component running within the Stanbol OSGi environment I got problems because the implementations provided by the JDK where not supporting methods called by Jackson (see [1] for details on the problem I encountered).

      However just replacing the default Stax 1 implementation with a Stax 2 implementation is not as easy as adding the required dependency as the lookup mechanism of Stax (ServiceLoader) does not work within OSGI.

      Because of that the Apache Servicemix project provides the org.apache.servicemix.specs.stax-api-1.2:2.4.0 module (see [2] for a really nice blog post with details).

      Required changes:

      1. the framework fragment needs to be adapted to no longer import the stax packages form the JDK
      2. the stanbol-commons bundlelist needs to be extended to provide the servicemix version of the stax-api spec.
      3. the stanbol-commons bundlelist also needs to provide an OSGI enabled stax implementation. I will choose woodstox as suggested in [1].

      After this both Stax 1 and Stax 2 will be available in Stanbol

      NOTE: Stax is already required by the commons.solr.* packages as Apache Solr uses it to parse its configuration files)

      [1] http://stackoverflow.com/questions/22950542/pretty-printing-xml-with-jackson-library
      [2] http://veithen.blogspot.co.at/2014/10/stax-osgi.html

        Attachments

          Activity

            People

            • Assignee:
              rwesten Rupert Westenthaler
              Reporter:
              rwesten Rupert Westenthaler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: