cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <>
Subject [jira] Created: (CXF-680) rest binding should support class without XmlRootElement
Date Thu, 24 May 2007 06:37:16 GMT
rest binding should support class without XmlRootElement

                 Key: CXF-680
             Project: CXF
          Issue Type: Improvement
            Reporter: Freeman Fang

currently, we need provide class XmlRootElement annotation for rest binding, otherwise we
will get exception like
INFO: Interceptor has thrown exception, unwinding now
	at org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.mergeParams(
	at org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.handleMessage(
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(
	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
	at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
	at org.mortbay.jetty.handler.ContextHandler.handle(
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
	at org.mortbay.jetty.handler.HandlerWrapper.handle(
	at org.mortbay.jetty.Server.handle(
	at org.mortbay.jetty.HttpConnection.handleRequest(
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(
	at org.mortbay.jetty.HttpParser.parseNext(
	at org.mortbay.jetty.HttpParser.parseAvailable(
	at org.mortbay.jetty.HttpConnection.handle(
	at org.mortbay.thread.BoundedThreadPool$
The reason is without @XmlRootElement, schema generated from the java class is XmlSchemaComplexType,
but currently what we expect is XmlSchemaElement

we can see 
oc = IriDecoderHelper.buildDocument((XmlSchemaElement)part.getXmlSchema(),
cause this exception, part.getXmlSchema() return XmlSchemaComplexType if without @XmlRootElement

more details are in the mail 

I got the following exception when querying the following URL of a modified
version of the restful_http_binding sample.

java.lang.ClassCastException :

The only change I made between this faulty version and a working one is
about the GetBook class that was rewriten and compiled in Groovy.  The
schema generated in now

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema elementFormDefault="qualified" version=" 1.0" targetNamespace="" xmlns:xs="">

 <xs:complexType name="getBook">
     <xs:element name="id" type="xs:long"/>

instead of

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema elementFormDefault="qualified" version="1.0" targetNamespace="" xmlns:tns=""

 <xs:element name="GetBook" type="tns:getBook"/>

 <xs:complexType name="getBook">
     <xs:element name="id" type="xs:long"/>

would these changes lead to that error ? My feeling is *no* since I did the
same change for other classes and this did not cause the same exception.

Thoughts ?


This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message