I have an Android app, which I connect to Google App Engine to fetch data.

I have two Resources used to fetch the data. 
One of them works perfectly fine, the second one gives the warning message:

WARNING: Unable to find a converter for this representation :
[application/x-java-serialized-object]

So I can´t get any data from this resource.

My setup is similar to the "First application" example found here:
http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html
First application 

This interface works:

public interface CouponResource {
    @Get
    public Coupon getCoupon();
}

This doesn´t:

public interface ExpertResource {
        @Get
        public GameCommentsAndStats getExpert(int gameId);
}

Any clues as to why?
Postning some more code below

Server resources:
public class CouponServerResource extends ServerResource implements
                CouponResource {

        private PersistenceManager pm = PMF.get().getPersistenceManager();

        private static final Logger _logger = Logger
                        .getLogger(CouponServerResource.class.getName());

        @Get
        public Coupon getCoupon() {
                Coupon c, detached = null;
                try {
                        Query query = pm.newQuery(Coupon.class);
                        query.setOrdering("round desc");
                        query.setRange(0, 1);
                        List<Coupon> result = ((List<Coupon>) query.execute());
                        c = result.get(0);
                        c.getGameList().get(0);
                        detached = pm.detachCopy(c);
                } catch (Exception e) {
                        System.err.println(e);
                }
                finally {
                        pm.close();
                }
                return detached;
        }

}

public class ExpertServerResource extends ServerResource implements
                ExpertResource {

        private PersistenceManager pm = PMF.get().getPersistenceManager();

        private static final Logger _logger = Logger
                        .getLogger(ExpertServerResource.class.getName());

                
        @Get
        public GameCommentsAndStats getExpert(int gameId) {
 
                GameCommentsAndStats stats = null, detached = null;
                try {
                        Key key =
KeyFactory.createKey(GameCommentsAndStats.class.getSimpleName(), gameId);
                        stats = pm.getObjectById(GameCommentsAndStats.class, 
key);
                        stats.getOutcome();
                        detached = pm.detachCopy(stats);
                } catch (Exception e) {
                        System.err.println(e);
                }
                finally {
                        pm.close();
                }
                return detached;
        }

}
-- 
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/WARNING-Unable-to-find-a-converter-for-this-representation-application-x-java-serialized-object-tp5468277p5468277.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

Reply via email to