cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arul Dhesiaseelan <a...@fluxcorp.com>
Subject Re: Marshalling Error: java.util.TreeSet
Date Thu, 10 Jul 2008 21:58:26 GMT
Hi Dan,

Thanks for your advice.

I was using CXF 2.1.1.

I tried using a simple Set and mapped XML adapters. It worked like a charm.

Thank you,
Arul

Daniel Kulp wrote:
>
> CXF 2.1.x or 2.0.x?
>
> I think a straight "Set" should work, but possibly not the specific 
> subtypes.   Not really sure.   I know that JAXB 2.1 enhanced the 
> support for Sets and maps a bit, but I don't know all the details.
>
> That said, if using CXF 2.1.1, you can get it to work by writing an 
> XmlAdapter and registering it with the @XmlJavaTypeAdapter 
> annotation.  In 2.1.x, the java_first_jaxws sample in the distribution 
> shows how to do that for a Map.
>
> Dan
>
>
>
> On Jul 9, 2008, at 4:46 PM, Arul Dhesiaseelan wrote:
>
>> Hello,
>>
>> I have a following method in my web service interface.
>>
>> public SortedSet<AgentInfo> getAll();
>>
>> In my implementation, I use TreeSet internally. When I invoke this 
>> method from a client, I get the following error.
>>
>> Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: 
>> Marshalling Error: java.util.TreeSet
>>   at 
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
>>   at $Proxy56.getAll(Unknown Source)
>>   at impl.services.client.AdminClient.getAll(AdminClient.java:114)
>>   at impl.services.testing.TestAdmin.main(TestAdmin.java:40)
>>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>   at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>   at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

>>
>>   at java.lang.reflect.Method.invoke(Method.java:585)
>>   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
>> Caused by: org.apache.cxf.binding.soap.SoapFault: Marshalling Error: 
>> java.util.TreeSet
>>   at 
>> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:70)

>>
>>   at 
>> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)

>>
>>   at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)

>>
>>   at 
>> org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)

>>
>>   at 
>> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:65)

>>
>>   at 
>> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)

>>
>>   at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)

>>
>>   at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
>>   at 
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)

>>
>>   at 
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)

>>
>>   at 
>> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>>   at 
>> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
>>   at 
>> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)

>>
>>   at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)

>>
>>   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
>>   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
>>   at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>>   at 
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
>>   ... 8 more
>>
>>
>> Any clues on this error? Is SortedSet/TreeSet not supported JAXB type?
>>
>> Please clarify.
>>
>> Thank you,
>> Arul
>>
>
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
>
>
>
> ________________________________
> Scanned by MessageLabs for Flux
> ________________________________


Mime
View raw message