Hi Atlassians (and maybe @kmacleod),
I see that a couple of new breaking changes have landed in 9.0.0-beta2:
Banned package warnings for javax.ws.rs
I am now seeing banned package warnings for javax.ws.rs
when loading apps (although the app still seems to work). This was working without logging warnings in the last half-dozen 9.0 milestones. The REST upgrade guide suggests that javax.ws.rs
is still the correct set of annotations to use for REST v2 annotations, so I don’t think I am doing anything wrong.
To be precise, I am now seeing errors like these:
2024-07-02 13:58:58,092 WARN [UpmAsynchronousTaskManager:thread-4] [osgi.hook.dmz.DmzResolverHook] filterMatches Package javax.ws.rs is internal and is not available for export to plugin com.myapp
Further investigation in DmzResolverHook
shows that the package resolution is attempted once against javax.ws.rs
in the system bundle (which passes), but resolution is attempted again against the old REST v1 module. As far as I know, my app isn’t referencing the REST v1 module at all, and it is the OSGi framework that is just looking for another match for javax.ws.rs
. Atlassian probably isn’t seeing this in its tests because its own plugins are exempt from many of these filters.
Import resolution succeeds against this bundle:
[org.apache.felix.framework [0](R 0)] osgi.wiring.package; {bundle-symbolic-name=[Ljava.lang.String;@4b8611d9, bundle-version=7.0.5, version=2.1.6, osgi.wiring.package=javax.ws.rs}
Import resolution fails and produces WARN messages against this bundle:
[com.atlassian.plugins.rest.atlassian-rest-module [165](R 165.0)] osgi.wiring.package; {bundle-symbolic-name=com.atlassian.plugins.rest.atlassian-rest-module, atlassian-access=internal, bundle-version=8.0.3, osgi.wiring.package=javax.ws.rs, version=1.1.1}
Version-pinning the OSGi import to 2.x to avoid this warning is not an option because it needs to work cross-major.
Ability to eliminate warnings for optional banned imports
With the web-fragments changes in 9.0.0-beta2, to retain cross-major compatibility, our app also needs to support both com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor
and the new com.atlassian.plugin.web.api.descriptors.WebItemModuleDescriptor
class.
We got this working by adding a resolution:="optional"
to the import of the old class, but this too dumps WARN messages in the log whenever the plugin is loaded on 9.x:
2024-07-02 13:51:16,756 WARN [QuickReload - Plugin Installer] [osgi.hook.dmz.DmzResolverHook] filterMatches Package com.atlassian.plugin.web.descriptors is internal and is not available for export to plugin com.myapp
Can the DmzResolverHook
be adjusted so that it (say) logs at a DEBUG
level when refusing an optional import, rather than a WARN
(which could be saved for required imports)? Alternatively, is there another approach you would suggest to vendors to avoid spamming customers’ logs with warnings?
Thanks!
Scott