Hi Sergey, The problem is that my method returns T, which is resolved by XMLGregorianCalendar instead of Date.
Adding a @XmlJavaTypeAdapter to the method with a custom XmlAdapter causes a JAXBException (unexpected element). Ivan -----Mensaje original----- De: Sergey Beryozkin [mailto:[email protected]] Enviado el: lunes, 11 de abril de 2011 12:45 Para: [email protected] Asunto: Re: Using Date instead of XmlGregorianCalendarImpl Hi Ivan You have to add an adapter, please see http://blogs.sun.com/CoreJavaTechTips/entry/exchanging_data_with_xml_and for an example. JAXBElementProvider won't check package-level adapters, at the moment you'll probably need to add it to a method returning a Date. I'll see what has be improved for package-level adapters be checked too Cheers, Sergey On Mon, Apr 11, 2011 at 9:25 AM, Ivan Vitoria Sanchez <[email protected] > wrote: > Hello, > > > > Is there any way to configure (via Spring) the JAXB provider in order to > use > "Date" instead of "XmlGregorianCalendarImpl" in the JAX-RS server? I'm > having XmlGregorianCalendarImpl instances when using a class which extend > from a generic type class and specifying Date as the type in my subclass. > > > > Many thanks, > > > > Ivan > > > >
