OSGi resolver issue with Confluence 8.4.0 and javax.print

Hi,

we just updated our plugin iFinder Confluence Search to support Confluence 8.x. It runs fine up to and including 8.3.x, but in 8.4.0 it cannot be activated with the following message:

[plugin.osgi.factory.OsgiPlugin] enableInternal Detected an error (BundleException) enabling the plugin 'com.intrafind.plugin.confluence.universal-search' : Unable to resolve com.intrafind.if-pl-ifcs7 [303](R 303.0): missing requirement [com.intrafind.if-pl-ifcs7 [303](R 303.0)] osgi.wiring.package; (osgi.wiring.package=javax.print) Unresolved requirements: [[com.intrafind.if-pl-ifcs7 [303](R 303.0)] osgi.wiring.package; (osgi.wiring.package=javax.print)]. This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see https://developer.atlassian.com/x/mQAN

It seems that this package should be provided by the System bundle, but apparently that’s somehow not the case anymore? Judging from the OSGi debugging page, the package is exported by the System bundle and other plugins like Confluence CQL plugin can import it successfully. What changed in 8.4 that makes this happen?

Our plugin is compiled against the 7.13.17 Confluence SDK, but as I said, it’s been working fine in previous 8.x versions.

Ciao,
Christoph

Digging a little deeper, it seems that com.atlassian.plugin.osgi.hook.DmzResolverHook is messing with the plugin and removing “possible exports”. That might lead to the resolver issue later.

It appears that Atlassian has silently disallowed importing the javax.print package for 3rd party plugins in Confluence 8.4.0. I’ve opened a bug report.

This is now confirmed as a bug and tracked in https://jira.atlassian.com/browse/CONFSERVER-90446. As a workaround, I’ve marked the resolution of javax.print* as optional in the bundle instructions because the plugin does not actually use the package to my knowledge, but the scan still picks it up: javax.print*;resolution:="optional"