Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Duplicate
-
15.0.0, 15.1.4
-
None
-
None
-
Flagged
-
Pulsar
Description
The "manual" REST services set-up is broken on 15 because creating a JAXB context fails in org.onehippo.cms7.essentials.components.rest.JaxbContextProvider#getContext.
This is due to inherited methods getNode and getObjectConverter of an HST bean that return interfaces which JAXB cannot handle and apparently the @XmlAccessorType(XmlAccessType.NONE) directive no longer works.
Note that JAXB was present in the Java 8 but on Java 11, the org.glassfish.jaxb:jaxb-runtime dependency is used (see here).
Reproduction:
- Create a 15.x archetype project, then in Essentials, add Simple Content, then through Tools, Rest Services Set-up, check "Enable manual REST resources", check contentdocument.
- Rebuild, restart, visit http://localhost:8080/site/api-manual/ContentDocument/
Error on screen:
JAXBException occurred : javax.xml.bind.JAXBException: class org.example.beans.ContentDocument$Contentdocument$yZkDy0Pv nor any of its super class is known to this context..
Underlying cause:
The bean is not known in the context because the JAXB context creation failed:
ERROR http-nio-8080-exec-9 [JaxbContextProvider.getContext:71] Error creating JAXB context: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions javax.jcr.Node is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at javax.jcr.Node at public javax.jcr.Node org.hippoecm.hst.content.beans.standard.HippoItem.getNode() at org.hippoecm.hst.content.beans.standard.HippoItem at org.hippoecm.hst.content.beans.standard.HippoDocument at org.example.beans.BaseDocument at org.example.beans.ContentDocument org.hippoecm.hst.content.beans.manager.ObjectConverter is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at org.hippoecm.hst.content.beans.manager.ObjectConverter at public org.hippoecm.hst.content.beans.manager.ObjectConverter org.hippoecm.hst.content.beans.standard.HippoItem.getObjectConverter() at org.hippoecm.hst.content.beans.standard.HippoItem at org.hippoecm.hst.content.beans.standard.HippoDocument at org.example.beans.BaseDocument at org.example.beans.ContentDocument
OAI PMH provider on Bloomreach Forge
The OAI PMH provider plugin's JaxbContextProvider creates a JAXB context in the same way as org.onehippo.cms7.essentials.components.rest.JaxbContextProvider so has the same underlying cause.
Attachments
Issue Links
- duplicates
-
CMS-15184 Standard Plain JAX-RS services breaks with JAXBException
- Closed