2

In Liferay 7 (DXP sp4) I need to install these OSGi modules:

https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient-osgi/4.5.3
https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore-osgi/4.4.6

So, I download them, put httpcore-osgi-4.4.6.jar in deploy/, it starts successfully as seen in Gogo Shell. Then I put httpclient-osgi-4.5.3.jar in deploy/, and…

ERROR [fileinstall-/home/nico/liferay/osgi/modules][org_eclipse_equinox_metatype:97] Unable to parse metadata XML at "bundleentry://540.fwk517213600/OSGI-INF/metatype/metatype.properties" for bundle ID "540" 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)

I don't know what this metatype.properties file is nor why Equinox tries to parse it as XML.

Is this JAR not a standard OSGi module?
Or does Liferay require a somehow different OSGi module?
Is it a problem with my configuration? (freshly installed)
Should I just ignore this ERROR?

The most incredible is that nonetheless the module gets started:

INFO  [fileinstall-/home/nico/liferay/osgi/modules][BundleStartStopLogger:35] STARTED org.apache.httpcomponents.httpclient_4.5.3 [540]
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
  • There are several reports on this error, e.g. https://stackoverflow.com/questions/5138696/org-xml-sax-saxparseexception-content-is-not-allowed-in-prolog and https://stackoverflow.com/questions/3030903/content-is-not-allowed-in-prolog-when-parsing-perfectly-valid-xml-on-gae. That doesn't help with this downloaded component, but it seems that filing an issue regarding packaging seems reasonable. There's nothing Liferay-specific that happens during the deploy process, it's being deployed by equinox as you can see in the stacktrace. – Olaf Kock Jul 28 '17 at 07:45
  • 1
    @OlafKock: I filed an issue at https://issues.apache.org/jira/browse/HTTPCLIENT-1862 thanks always for the feedback! – Nicolas Raoul Jul 28 '17 at 08:07
  • 2
    @OlafKock: The issue was closed as `Won't fix`, they think the problem is either with the OSGi container or Apache Felix maven-bundle-plugin. – Nicolas Raoul Aug 07 '17 at 03:24
  • I know this is an old one now, we had this error message. If you update the liferay 7.2 you can use JDK11 which has a native http client instead. – Chris M Jun 11 '19 at 13:20
  • Ticket open at Equinox project https://bugs.eclipse.org/bugs/show_bug.cgi?id=551228 – Thiago Leão Moreira Sep 19 '19 at 02:05

1 Answers1

0

The problem seems to be rooted at the MetaTypeProviderImpl.java:91. The class is loading all (*) metadata files and reading them as a XML.