Platform 7 upgrade in progress: Learn about the first highlights and changes

Hi @MarekTokarski

Regarding REST v2, I was hoping you could provide guidance on how to migrate a ServiceExceptionMapper to REST v2. We implemented a RestExceptionMapper because Atlassian says that we should use one to implement Confluence Read-Only mode.

The ServiceExceptionMapper class is defined in the com.atlassian.confluence:confluence-rest-api artifact.

When I tried to migrate to REST v2, I added com.atlassian.plugins.rest:atlassian-rest-v2-api to the POM as instructed and built without removing the old confluence-rest-api package.

The build succeeds (with both modules as scope=provided), but the app fails on install to Confluence 9.0.0-m13 with the error below:

Caused by: org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve resource myapp [myapp [301](R 301.0)] because it is exposed to package 'javax.ws.rs' from resources com.atlassian.plugins.rest.atlassian-rest-v2-plugin [com.atlassian.plugins.rest.atlassian-rest-v2-plugin [163](R 163.0)] and org.apache.felix.framework [org.apache.felix.framework [0](R 0)] via two dependency chains.

Chain 1:
  myapp [myapp [301](R 301.0)]
    import: (osgi.wiring.package=javax.ws.rs)
     |
    export: osgi.wiring.package: javax.ws.rs
  com.atlassian.plugins.rest.atlassian-rest-v2-plugin [com.atlassian.plugins.rest.atlassian-rest-v2-plugin [163](R 163.0)]

Chain 2:
  myapp [myapp [301](R 301.0)]
    import: (osgi.wiring.package=com.atlassian.plugins.rest.common.security)
     |
    export: osgi.wiring.package=com.atlassian.plugins.rest.common.security; uses:=javax.ws.rs
  com.atlassian.plugins.rest.atlassian-rest-module [com.atlassian.plugins.rest.atlassian-rest-module [162](R 162.0)]
    import: (&(osgi.wiring.package=javax.ws.rs)(version>=1.1.1))
     |
    export: osgi.wiring.package: javax.ws.rs

But if I remove confluence-rest-api from the POM, it won’t even compile because the ServiceExceptionMapper class is gone.

Your insight would be appreciated.