javax.xml.bind.JAXBException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When using MarshallingView with a Jaxb2Marshaller and more than one object in the model has JAXB annotations on it, automatic detection of the appropriate object in the model does not work as expected. Using this example MVC RESTful service: Request and Response classes: {code} @XmlRootElement(name = "request") public class HelloRequest { private String name; private String title; // getters and setters } @XmlRootElement(name = "response") public class HelloResponse { private String message; // getters and setters } {code} Controller: {code} @Controller @RequestMapping("/Hello") public class HelloController { @RequestMapping(value = "/greet", method = RequestMethod.GET) public HelloResponse greetGet(HelloRequest request) { String message = "Hello, " + request.getTitle() + " " + request.getName(); return new HelloResponse(message); } } {code} -servlet.xml {code} <beans xmlns=...> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> <property name="mediaTypes"> <map><entry key="xml" value="application/xml"/></map> </property> <property name="viewResolvers"> <list> <bean class="org.springframework.web.servlet.view.ContentTypeViewResolver" p:order="1" p:view-ref="xmlView"/> </list> </property> <property name="order" value="0"/> </bean> <bean id="xmlView" class="org.springframework.web.servlet.view.xml.MarshallingView"> <property name="marshaller" ref="marshaller"/> </bean> <oxm:jaxb2-marshaller id="marshaller"> <oxm:class-to-be-bound name="com.test.domain.HelloResponse"/> </oxm:jaxb2-marshaller> <bean name="helloMvc" class="com.test.hello.HelloController"/> </beans> {code} In this scenario, the Controller simply returns a response object. The model is automatically generated, and includes both the request and response objects (along with a few other objects). The model is passed to the MarshallingView, which tries to detect the appropriate model object for rendering the view (since no modelKey property was set on the MarshallingView). MarshallingView calls the supports() method of the configured Marshaller with each object in the model until supports() returns true. The detected object is then passed to the Marshaller for marshalling. When MarshallingView is used with Jaxb2Marshaller this causes a problem. Jaxb2Marshaller.supports(Class<?> c) will return true for any type that has a JAXB @XmlRootElement annotation on it, even if that Marshaller is not configured to support that class. In this scenario, MarshallingView encounters the request object in the model first and passes it to Jaxb2Marshaller.supports(), which returns true because the request object is annotated with @XmlRootElement. MarshallingView then passes the request object to Jaxb2Marshaller.marshal(). This call fails because the Marshaller is not configured to handle HelloRequest objects: {code}org.springframework.oxm.UncategorizedMappingException: Unknown JAXB exception; nested exception is javax.xml.bind.JAXBException: class com.test.domain.HelloRequest nor any of its super class is known to this context. at org.springframework.oxm.jaxb.Jaxb2Marshaller.convertJaxbException(Jaxb2Marshaller.java:580) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:412) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:395) at org.springframework.web.servlet.view.xml.MarshallingView.renderMergedOutputModel(MarshallingView.java:103) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647) ... 37 more Caused by: javax.xml.bind.JAXBException: class com.test.domain.HelloRequest nor any of its super class is known to this context. at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:554) at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:470) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:314) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:243) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:408) ... 44 more {code} If the Jaxb2Marshaller were configured to support HelloRequest objects, then this exception would not be thrown but the request object would incorrectly be marshalled to the output view instead of the response object. To fix this, either the @XmlRootElement must be removed from the HelloRequest class, or the modelKey property must be set on the MarshallingView (to "helloResponse" in this case) to override automatic detection of the appropriate model object. Neither of these is a good solution. * The HelloRequest class does not need the @XmlRootElement annotation on it for this example, but in the real-world scenario this class is also used for other POST requests with the @RequestBody annotation. * Setting the modelKey property on the view would require a unique view bean to match each response object, since the name of the response object class is used to generate the model key.
    via by Scott Frederick,
  • When using MarshallingView with a Jaxb2Marshaller and more than one object in the model has JAXB annotations on it, automatic detection of the appropriate object in the model does not work as expected. Using this example MVC RESTful service: Request and Response classes: {code} @XmlRootElement(name = "request") public class HelloRequest { private String name; private String title; // getters and setters } @XmlRootElement(name = "response") public class HelloResponse { private String message; // getters and setters } {code} Controller: {code} @Controller @RequestMapping("/Hello") public class HelloController { @RequestMapping(value = "/greet", method = RequestMethod.GET) public HelloResponse greetGet(HelloRequest request) { String message = "Hello, " + request.getTitle() + " " + request.getName(); return new HelloResponse(message); } } {code} -servlet.xml {code} <beans xmlns=...> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> <property name="mediaTypes"> <map><entry key="xml" value="application/xml"/></map> </property> <property name="viewResolvers"> <list> <bean class="org.springframework.web.servlet.view.ContentTypeViewResolver" p:order="1" p:view-ref="xmlView"/> </list> </property> <property name="order" value="0"/> </bean> <bean id="xmlView" class="org.springframework.web.servlet.view.xml.MarshallingView"> <property name="marshaller" ref="marshaller"/> </bean> <oxm:jaxb2-marshaller id="marshaller"> <oxm:class-to-be-bound name="com.test.domain.HelloResponse"/> </oxm:jaxb2-marshaller> <bean name="helloMvc" class="com.test.hello.HelloController"/> </beans> {code} In this scenario, the Controller simply returns a response object. The model is automatically generated, and includes both the request and response objects (along with a few other objects). The model is passed to the MarshallingView, which tries to detect the appropriate model object for rendering the view (since no modelKey property was set on the MarshallingView). MarshallingView calls the supports() method of the configured Marshaller with each object in the model until supports() returns true. The detected object is then passed to the Marshaller for marshalling. When MarshallingView is used with Jaxb2Marshaller this causes a problem. Jaxb2Marshaller.supports(Class<?> c) will return true for any type that has a JAXB @XmlRootElement annotation on it, even if that Marshaller is not configured to support that class. In this scenario, MarshallingView encounters the request object in the model first and passes it to Jaxb2Marshaller.supports(), which returns true because the request object is annotated with @XmlRootElement. MarshallingView then passes the request object to Jaxb2Marshaller.marshal(). This call fails because the Marshaller is not configured to handle HelloRequest objects: {code}org.springframework.oxm.UncategorizedMappingException: Unknown JAXB exception; nested exception is javax.xml.bind.JAXBException: class com.test.domain.HelloRequest nor any of its super class is known to this context. at org.springframework.oxm.jaxb.Jaxb2Marshaller.convertJaxbException(Jaxb2Marshaller.java:580) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:412) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:395) at org.springframework.web.servlet.view.xml.MarshallingView.renderMergedOutputModel(MarshallingView.java:103) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647) ... 37 more Caused by: javax.xml.bind.JAXBException: class com.test.domain.HelloRequest nor any of its super class is known to this context. at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:554) at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:470) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:314) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:243) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:408) ... 44 more {code} If the Jaxb2Marshaller were configured to support HelloRequest objects, then this exception would not be thrown but the request object would incorrectly be marshalled to the output view instead of the response object. To fix this, either the @XmlRootElement must be removed from the HelloRequest class, or the modelKey property must be set on the MarshallingView (to "helloResponse" in this case) to override automatic detection of the appropriate model object. Neither of these is a good solution. * The HelloRequest class does not need the @XmlRootElement annotation on it for this example, but in the real-world scenario this class is also used for other POST requests with the @RequestBody annotation. * Setting the modelKey property on the view would require a unique view bean to match each response object, since the name of the response object class is used to generate the model key.
    via by Scott Frederick,
  • h3. Summary JIRA REST API throws a 500 Internal Server Error on OPTIONS request type h3. Steps to Reproduce - {{curl -D - -X OPTIONS http://localhost:8080/705/rest/api/2/issue}} -- Produces: {code:borderStyle=solid} $ 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 {code} h3. Expected Results - 200 OK {code:borderStyle=solid} $ 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 {code} (i) Preferably the 'Allow' header showing acceptable request types as well h3. Actual Results - 500 Internal Server Error response - The below exception is thrown in the atlassian-jira.log file: {noformat} 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 {noformat} h3. Notes - The OPTIONS request type is standard behavior during cross-domain requests aka 'preflight' requests to see what's allowed. -- See https://en.wikipedia.org/wiki/Cross-origin_resource_sharing#Preflight_example for example h3.Workaround - No known workaround at this time.
    via by Pelle Kirkeby,
  • h3. Summary JIRA REST API throws a 500 Internal Server Error on OPTIONS request type h3. Steps to Reproduce - {{curl -D - -X OPTIONS http://localhost:8080/705/rest/api/2/issue}} -- Produces: {code:borderStyle=solid} $ 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 {code} h3. Expected Results - 200 OK {code:borderStyle=solid} $ 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 {code} (i) Preferably the 'Allow' header showing acceptable request types as well h3. Actual Results - 500 Internal Server Error response - The below exception is thrown in the atlassian-jira.log file: {noformat} 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 {noformat} h3. Notes - The OPTIONS request type is standard behavior during cross-domain requests aka 'preflight' requests to see what's allowed. -- See https://en.wikipedia.org/wiki/Cross-origin_resource_sharing#Preflight_example for example h3.Workaround - No known workaround at this time.
    via by Pelle Kirkeby,
    • javax.xml.bind.JAXBException: class com.test.domain.HelloRequest nor any of its super class is known to this context. at org.springframework.oxm.jaxb.Jaxb2Marshaller.convertJaxbException(Jaxb2Marshaller.java:580) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:412) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:395) at org.springframework.web.servlet.view.xml.MarshallingView.renderMergedOutputModel(MarshallingView.java:103) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647) Caused by: javax.xml.bind.JAXBException: class com.test.domain.HelloRequest nor any of its super class is known to this context. at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:554) at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:470) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:314) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:243) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:408) ... 9 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    bernardpaulus
    1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    3 more bugmates