cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessio Soldano (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CXF-5110) Wrong processing of @XmlJavaTypeAdapter with RPC style endpoints
Date Fri, 05 Jul 2013 10:33:48 GMT
Alessio Soldano created CXF-5110:
------------------------------------

             Summary: Wrong processing of @XmlJavaTypeAdapter with RPC style endpoints
                 Key: CXF-5110
                 URL: https://issues.apache.org/jira/browse/CXF-5110
             Project: CXF
          Issue Type: Bug
          Components: JAXB Databinding
            Reporter: Alessio Soldano
            Assignee: Alessio Soldano
             Fix For: 2.6.9, 2.7.6, 3.0.0


I've tried building a client for an endpoint whose interface is as follows:

{code}
@WebService(targetNamespace = "http://www.jboss.org/wise/adapter/", name = "Endpoint")
@XmlSeeAlso({ObjectFactory.class})
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface Endpoint {

    @WebResult(name = "mimepart", targetNamespace = "http://www.jboss.org/wise/adapter/",
partName = "mimepart")
    @XmlJavaTypeAdapter(value = HexBinaryAdapter.class)
    @WebMethod
    public byte[] getData(
        @WebParam(partName = "dataQuery", mode = WebParam.Mode.INOUT, name = "dataQuery")
        javax.xml.ws.Holder<DataQuery> dataQuery
    );
}
{code}

and I'm getting the following exception:

{noformat}
2013-07-04 16:39:10,209 WARN  [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for
{http://www.jboss.org/wise/adapter/}EndpointService#{http://www.jboss.org/wise/adapter/}getData
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: org.jboss.wise.adapter.DataQuery cannot
be cast to [B
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshalWithBridge(JAXBEncoderDecoder.java:298)
	at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:174)
	at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:121)
	at org.apache.cxf.binding.soap.interceptor.RPCOutInterceptor.handleMessage(RPCOutInterceptor.java:90)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
	at com.sun.proxy.$Proxy46.getData(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.wise.core.client.impl.reflection.EndpointMethodCaller.call(EndpointMethodCaller.java:73)
	at org.jboss.wise.core.client.impl.reflection.EndpointMethodPreview.call(EndpointMethodPreview.java:61)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)
Caused by: javax.xml.bind.MarshalException
 - with linked exception:
[java.lang.ClassCastException: org.jboss.wise.adapter.DataQuery cannot be cast to [B]
	at com.sun.xml.bind.v2.runtime.BridgeAdapter._adaptM(BridgeAdapter.java:122)
	at com.sun.xml.bind.v2.runtime.BridgeAdapter.adaptM(BridgeAdapter.java:109)
	at com.sun.xml.bind.v2.runtime.BridgeAdapter.marshal(BridgeAdapter.java:85)
	at com.sun.xml.bind.api.Bridge.marshal(Bridge.java:111)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.apache.cxf.common.util.ReflectionInvokationHandler.invoke(ReflectionInvokationHandler.java:54)
	at com.sun.proxy.$Proxy47.marshal(Unknown Source)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshalWithBridge(JAXBEncoderDecoder.java:280)
	... 22 more
Caused by: java.lang.ClassCastException: org.jboss.wise.adapter.DataQuery cannot be cast to
[B
	at javax.xml.bind.annotation.adapters.HexBinaryAdapter.marshal(HexBinaryAdapter.java:39)
	at com.sun.xml.bind.v2.runtime.BridgeAdapter._adaptM(BridgeAdapter.java:119)
	... 32 more
{noformat}

The problem seems to be basically due to JAXBDataBase#getJAXBAnnotation(MessagePartInfo mpi)
searching return annotations even for input messages.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message