Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-59407

JIRA REST API throws a 500 Internal Server Error on OPTIONS request type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 7.0.2, 7.0.5, 7.0.4
    • REST API

      Summary

      JIRA REST API throws a 500 Internal Server Error on OPTIONS request type

      Steps to Reproduce

      • curl -D - -X OPTIONS http://localhost:8080/705/rest/api/2/issue
        • Produces:
          $ curl -D - -X OPTIONS http://localhost:8080/705/rest/api/2/issue
          HTTP/1.1 500 Internal Server Error
          Server: Apache-Coyote/1.1
          X-AREQUESTID: 782x91x1
          X-ASEN: SEN-L1654596
          Set-Cookie: atlassian.xsrf.token=BCN0-D245-88JR-K3BT|2de06cd32474a1d714c16acd9be73f171158ce3d|lout; Path=/705
          X-AUSERNAME: anonymous
          Allow: GET, HEAD, POST, TRACE, OPTIONS
          X-Content-Type-Options: nosniff
          Content-Type: application/vnd.sun.wadl+xml;charset=UTF-8
          Content-Length: 0
          Date: Fri, 15 Jan 2016 19:02:57 GMT
          Connection: close
          

      Expected Results

      • 200 OK
        $ curl -D - -X OPTIONS http://localhost:9000/rest/api/2/issue
        HTTP/1.1 200 OK
        Server: Apache-Coyote/1.1
        X-AREQUESTID: 784x33097x1
        X-ASEN: SEN-L1654596
        Set-Cookie: atlassian.xsrf.token=BQC7-UIYC-U3FD-T8N9|b8759df724dc668a5d886470438e25f46e505253|lout; Path=/
        X-AUSERNAME: anonymous
        Content-Type: text/html;charset=UTF-8
        Content-Length: 0
        Date: Fri, 15 Jan 2016 19:04:52 GMT
        

        Preferably the 'Allow' header showing acceptable request types as well

      Actual Results

      • 500 Internal Server Error response
      • The below exception is thrown in the atlassian-jira.log file:
        2016-01-15 12:36:20,536 http-nio-8080-exec-12 ERROR anonymous 756x85x1 - 0:0:0:0:0:0:0:1 /rest/api/2/group [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Server Error in REST: 500: com.sun.jersey.core.spi.factory.ResponseImpl@1b1274b1
        javax.ws.rs.WebApplicationException: javax.xml.bind.MarshalException
         - with linked exception:
        [com.sun.istack.internal.SAXException2: com.sun.jersey.server.wadl.generators.resourcedoc.xhtml.XhtmlElementType is not known to this context
        javax.xml.bind.JAXBException: com.sun.jersey.server.wadl.generators.resourcedoc.xhtml.XhtmlElementType is not known to this context]
        	at com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.writeTo(AbstractRootElementProvider.java:159)
        	at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)
        	... 5 filtered
        	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178)
        	... 1 filtered
        	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73)
        	... 101 filtered
        	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40)
        	... 73 filtered
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        	at java.lang.Thread.run(Thread.java:745)
        Caused by: javax.xml.bind.MarshalException
         - with linked exception:
        [com.sun.istack.internal.SAXException2: com.sun.jersey.server.wadl.generators.resourcedoc.xhtml.XhtmlElementType is not known to this context
        javax.xml.bind.JAXBException: com.sun.jersey.server.wadl.generators.resourcedoc.xhtml.XhtmlElementType is not known to this context]
        	at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:311)
        	at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:236)
        	at com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.writeTo(AbstractRootElementProvider.java:179)
        	at com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.writeTo(AbstractRootElementProvider.java:157)
        	... 188 more
        Caused by: com.sun.istack.internal.SAXException2: com.sun.jersey.server.wadl.generators.resourcedoc.xhtml.XhtmlElementType is not known to this context
        javax.xml.bind.JAXBException: com.sun.jersey.server.wadl.generators.resourcedoc.xhtml.XhtmlElementType is not known to this context
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:232)
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:247)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:132)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:115)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:324)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:60)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayReferenceNodeProperty.serializeListBody(ArrayReferenceNodeProperty.java:103)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:144)
        	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:345)
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:54)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:157)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:144)
        	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:345)
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
        	at com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:143)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:145)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:115)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:317)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:324)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:60)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayReferenceNodeProperty.serializeListBody(ArrayReferenceNodeProperty.java:103)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:144)
        	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:345)
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
        	at com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:143)
        	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:345)
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:54)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:157)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:144)
        	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:345)
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:54)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:157)
        	at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:144)
        	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:345)
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
        	at com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:143)
        	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:345)
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:578)
        	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:326)
        	at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:479)
        	at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:308)
        	... 192 more
        Caused by: javax.xml.bind.JAXBException: com.sun.jersey.server.wadl.generators.resourcedoc.xhtml.XhtmlElementType is not known to this context
        	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:598)
        	at com.sun.xml.internal.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:129)
        	... 234 more
        

      Notes

      Workaround

      • No known workaround at this time.

              Unassigned Unassigned
              pkirkeby Pelle Kirkeby (Inactive)
              Votes:
              13 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated: