Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-15226

Manual Rest API broken on 15, error creating JAXB context

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Duplicate
    • 15.0.0, 15.1.4
    • 15.2.0
    • 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:

      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

          Activity

            People

              sshepelevich Sergey Shepelevich
              jhoffman Jeroen Hoffman
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: