Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1919

Equinox SAXException when starting OSGi module httpclient-osgi-4.5.5.jar

    XMLWordPrintableJSON

    Details

      Description

      This error occurs when starting Liferay 7.1 alpha when the OSGi module httpclient-osgi-4.5.5.jar is used:

      {{2018-04-26 14:40:20.891 ERROR [main][org_eclipse_equinox_metatype:97] Unable to parse metadata XML at "bundleentry://45.fwk1343457451/OSGI-INF/metatype/metatype.properties" for bundle ID "45" with symbolic name "org.apache.httpcomponents.httpclient". }}
      org.xml.sax.SAXException: Fatal Error: URI=null Line=1: Content is not allowed in prolog.
          at org.eclipse.equinox.metatype.impl.DataParser$MyErrorHandler.fatalError(DataParser.java:856)

      The issue is that the metatype.properties file is being parsed as XML (but is not XML). I believe the problem is that the metatype.properties file in httpclient-osgi-4.5.5.jar is in the wrong location.

      According to the OSGi spec, only metatype XML files should be in the OSGI-INF/metatype folder. See https://osgi.org/specification/osgi.cmpn/7.0.0/service.metatype.html#d0e16879

      However, in httpclient-osgi-4.5.5.jar, there are two files in this folder: metatype.xml and metatype.properties.

      The spec indicates that metatype localization files should go in the OSGI-INF/l10n folder. See https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#i3189742

      Moving the metatype.properties from OSGI-INF/metatype to OSGI-INF/l10n should solve the problem.

      Related issue: HTTPCLIENT-1862

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jesse.rao Jesse Rao
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: