Description
1. Using Reader's Implementation BufferedReader:
@POST
@Path("/subclasses/shouldfail")
public BufferedReader postReader(BufferedReader br)
Exception stack:
Caused by: java.lang.ClassCastException: Cannot cast class java.io.InputStreamReader to class java.io.BufferedReader
at java.lang.Class.cast(Class.java:1730)
at org.apache.cxf.jaxrs.provider.BinaryDataProvider.readFrom(BinaryDataProvider.java:77)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1311)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1262)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:801)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:764)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:212)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:76)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
... 19 more
2. Using ByteArrayInputStream:
@POST
@Path("/subclasses/shouldfail")
public ByteArrayInputStream postInputStream(ByteArrayInputStream is)
Exception stack:
Caused by: java.lang.ClassCastException: Cannot cast class org.apache.cxf.transport.http.AbstractHTTPDestination$1 to class java.io.ByteArrayInputStream
at java.lang.Class.cast(Class.java:1730)
at org.apache.cxf.jaxrs.provider.BinaryDataProvider.readFrom(BinaryDataProvider.java:74)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1311)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1262)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:801)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:764)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:212)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:76)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
... 19 more
3. Using Source's implmentation class:
public static class UnsupportedSourceSubclass implements Source {
public String getSystemId()
{ return null; } public void setSystemId(String systemId) {
}
}
@POST
@Path("/subclasses/shouldfail")
public UnsupportedSourceSubclass postReader(UnsupportedSourceSubclass saxSource)
Exception stack:
Caused by: java.lang.ClassCastException: Cannot cast class javax.xml.transform.stream.StreamSource to class com.test.jaxrs.fat.standard.SourceResource$UnsupportedSourceSubclass
at java.lang.Class.cast(Class.java:1730)
at org.apache.cxf.jaxrs.provider.SourceProvider.readFrom(SourceProvider.java:115)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1311)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1262)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:801)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:764)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:212)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:76)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
... 19 more