[geotk] CSW client : unmarshalling issue

Damiano ALBANI damiano.albani at univ-nantes.fr
Tue May 10 11:09:55 EDT 2011


On 05/10/2011 04:52 PM, Martin Desruisseaux wrote:
> Could you post the full stack trace that you get please?

Well, all I get is :

Exception in thread "main" java.lang.ClassCastException: 
javax.xml.bind.JAXBElement cannot be cast to 
org.geotoolkit.csw.xml.GetRecordsResponse
     at TestCSW.getRecords(TestCSW.java:111)
     at TestCSW.main(TestCSW.java:45)

But, I don't think that this exception is important in itself.
It's more like a symptom of the inability to properly unmarshall a 
GetRecordsResponse.
The type of the object returned by the unmarshaller is JAXBElement, 
instead of GetRecordsResponse.
That's why it throws an exception when I try to cast the object.
So I think the question is : "why does the unmarshaller returns a raw 
JAXBElement ?" Whereas it works just fine with a Capabilities object.

Regards,

-- 
Damiano ALBANI



More information about the Geotoolkit mailing list