Hi, I'm trying to unmarshal some XML using the jaxb extension on GAE (version 
2.1m3)

String xml ="<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
Representation re = new StringRepresentation( xml );
Representation xmlRe = new JaxbRepresentation<Kml>( re, Kml.class );
ConverterHelper decoder = new JaxbConverter();
Kml kmloutput = decoder.toObject( xmlRe, Kml.class, null );

the call JaxbConverter.toObject() calls JaxbRepresentation.getObject() and that 
calls

this.object = (T) u.unmarshal(this.xmlRepresentation
                        .getReader());

Then WriterRepresentation.getReader() calls BioUtils.getReader():

   @Override
    public Reader getReader() throws IOException {
        return BioUtils.getReader(this);
    }

Finally BioUtils.getReader() returns null:

        Reader result = null;
        if (Edition.CURRENT != Edition.GAE) {
        } else {
            Context.getCurrentLogger()
                    .log(Level.WARNING,
                            "The GAE edition is unable to return a reader for a 
writer representation.");
        }
        return result;


I don't know why GAE has got this limitation but isn't there any way to work 
around it?

There's a numer of unmarshal() methods in the Unmarshaller class that could be 
used as an alternative.

If there's another way to unmarshal JaxbRepresentation objects in GAE please 
let me know.

Thank you,
Emanuele

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

Reply via email to