Missing requirement: org.apache.log4j of Geotools

Hi,

I have a bundle org.geotools in my plugin. The bundle org.geotools requires log4j in version 1.2.15 (log4j-1.2.15.jar). Everything worked fine with KNIME 4.5 but KNIME 4.6 uses log4j in version 1.2.21 (reload4j-1.2.21.jar). To fix the issue I added 2 bundles:

  • ch.qos.reload4j (with Bundle-SymbolicName: org.apache.log4j) that uses reload4j-1.2.21.jar.
  • org.apache.log4jx that uses log4j-1.2.15.jar

The manifest for my bundle org.geotools specifies “Require-Bundle: org.apache.log4jx;visibility:=reexport

The Eclipse IDE is fine with this configuration. The mvn building of my update site succeeds but during installation of my plugin in KNIME4.6.4 I get the following error:

Cannot complete the install because one or more required items could not be found.
Software being installed: KNIME Nodes for … 1.1.43.202301131246 (de…feature.feature.group 1.1.43.202301131246)
Missing requirement: Geotools 28.0.0 (org.geotools 28.0.0) requires ‘java.package; org.apache.log4j 1.2.15’ but it could not be found
Cannot satisfy dependency:
From: KNIME Nodes for … 1.1.43.202301131246 (de…feature.feature.group 1.1.43.202301131246)
To: org.eclipse.equinox.p2.iu; org.geotools [28.0.0,28.0.0]

I checked already that the bundles log.apache.log4j-1.2.21.jar and org.apache.log4jx-1.2.15.jar are in my update side.
What am I doing wrong?

Best regards,
Marco

To solve this issue:

  • I put the log4j-1.2.15.jar directly into my org.geotools bundle and put it in the first position of its classpath
  • I removed the unused Bundle org.apache.log4jx.