JaxBConverter was added in 2.0M5 and the implementation is broken. I wrote a
custom JaxBConverter and registered; seems to be working. 

There are a few things:
1) null checks to return an EmptyRepresentation() needs to be implemented
2)  getObjectClasses has been overridden incorrectly. 

public List<Class<?>> getObjectClasses(Variant source) {   
    List<Class<?>> result = null;
    return result;
}

I changed to:

public List<Class<?>> getObjectClasses(Variant source) {
    List<Class<?>> result = null;

    if (VARIANT_APPLICATION_ALL_XML.isCompatible(source)
            || VARIANT_APPLICATION_XML.isCompatible(source)
            || VARIANT_TEXT_XML.isCompatible(source)) {
                 result = addObjectClass(result, JaxbRepresentation.class);
 }

        return result;
    }

I can provide a patch in a day or two once tested thoroughly.




jlouvel wrote:
> 
> Hi anonymous,
> 
> I've changed the title because it wasn't very informative...
> 
> I confirmed that nothing changed in the JaxbRepresentation since 2.0 M4.
> So,
> it must be related to something else, like your resource class.
> 
> Could you send over some working code reproducing your issue?
> 
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
> 
> 
> -----Message d'origine-----
> De : infinity [mailto:infinity2hea...@gmail.com] 
> Envoyé : lundi 28 septembre 2009 21:09
> À : discuss@restlet.tigris.org
> Objet : 2.0 M5 is broken
> 
> I've spend two hours debugging my application just to realize that "just
> by
> replacing 2.0 M4" jars, the applications works fine. 
> 
> Somewhere in my app code, I return a http status, followed by a Xml
> object,
> however in 2.0 M5 the xml object is never returned (the http error status
> is
> returned or an empty xml is returned)
> 
> return new JaxbRepresentation<Error>(MediaType.TEXT_XML, error);
> 
> I looked at the changelog of M5 and doesn't appear to me that anything has
> changed wr JaxbRepresentation
> 
> WHAT has changed?
> -- 
> View this message in context:
> http://n2.nabble.com/2-0-M5-is-broken-tp3731286p3731286.html
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
> 
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24013
> 64
> 
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2401487
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/2-0-M5-is-broken-tp3731286p3739302.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2401802

Reply via email to