REST Endpoints in Confluence 3.1.x don't work
Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
The general symptom is that REST endpoints implemented using the REST module type won't work. More specificly features like gadgets or the "Confluence Gadgets" dialog stop working.
Select 'Confluence Gadgets' from the Browse menu, and it gives error:
An error has occurred while trying to load the gadget directory.
Cause
This is caused by the fact that on JDK 1.6 Atlassian Plugins exports the javax.xml.bind (JAXB) packages from the host (Confluence). Those packages are also exported by the REST module plugin. If the a plugin containing a REST module (like the Confluence gadgets plugin) binds to the packages exported by the host, it will not work, as the annotations used to mark a class as a REST resource are loaded from different class loaders.
Workaround
The current workaround is to place a patched jdk6-packages.txt in the WEB-INF/classes directory and restart Confluence.
jdk6-packages.txt
# Java package list pulled from Java SE 6 (excluding java.*) with those in jdk-packages.txt removed
# Copied from the packages frame in the Javadocs - http://java.sun.com/javase/6/docs/api/index.html
javax.activation
javax.annotation
javax.annotation.processing
javax.jws
javax.jws.soap
javax.lang.model
javax.lang.model.element
javax.lang.model.type
javax.lang.model.util
javax.script
javax.tools
javax.xml.crypto
javax.xml.crypto.dom
javax.xml.crypto.dsig
javax.xml.crypto.dsig.dom
javax.xml.crypto.dsig.keyinfo
javax.xml.crypto.dsig.spec
javax.xml.soap
javax.xml.stream
javax.xml.stream.events
javax.xml.stream.util
javax.xml.transform.stax
javax.xml.ws
javax.xml.ws.handler
javax.xml.ws.handler.soap
javax.xml.ws.http
javax.xml.ws.soap
javax.xml.ws.spi
javax.xml.ws.wsaddressing
Resolution
Track a resolution at CONF-17417.
Was this helpful?