Hi Marcin, You need to use concrete classes as parameters such as ArrayList instead of List/Set otherwise GWT can deserialize them.
Best regards, Jerome -- Restlet ~ Founder and Technical Lead ~ http://www.restlet.org Noelios Technologies ~ http://www.noelios.com -----Message d'origine----- De : Marcin Stelmach [mailto:[email protected]] Envoyé : jeudi 28 avril 2011 17:53 À : [email protected] Objet : Problem with Restlet client under GWT (returns NULL). Hello, I'm experiencing a problem related with Restlet client under GWT (returns NULL). Example resource interface: public interface VOResource { @Get public List<VO> retrieve(); } where: public class VOImpl implements VO, Serializable { public static final long serialVersionUID = 1L; private String id = ""; private String name = ""; private Set<User> users = new HashSet<User>(); private Set<Resource> resources = new HashSet<Resource>(); //setters and getters } User and Resource are Serializable. public class VOServerResource extends ServerResource implements VOResource { @Override public List<VO> retrieve() { addAccessControl(getResponse()); List<VO> result= new ArrayList<VO>(); VO vo = new VOImpl("id1", "test 1"); Set<Resource> resources = new HashSet<Resource>(); resources.add(new ResourceImpl("res1","resource 1")); Set<User> users = new HashSet<User>(); users.add(new UserImpl("user1", "User 2")); users.add(new UserImpl("user2", "User 2")); vo.setUsers(users); \\ (1) vo.setResources(resources); \\ (2) VO vo2 = new VOImpl("id2", "test 2"); vo2.setUsers(users); \\ (3) result.add(vo); result.add(vo2); return result; } } On GWT site I have interface proxy: public interface VOResourceProxy extends ClientProxy { @Get public void retrieve(Result<List<VO>> callback); } client code: VOResourceProxy vosResource = GWT.create(VOResourceProxy.class); vosResource.getClientResource().getClientInfo().setAcceptedMediaTypes(Arrays.asList(new Preference<MediaType>(MediaType.APPLICATION_JAVA_OBJECT_GWT))); vosResource.retrieve(new Result<List<VO>>() { @Override public void onSuccess(List<VO> result) { // here result is NULL } } My problem is the following: If I add a set of Users or Resources to the VO object on server side [(1), (2), (3)] then client has List<VO> result = NULL, but when I don't add a set of Users or Resources to the VO object then client ownse a List<VO>. For example server returns: //OK[12,11,0,4,0,4,3,2,10,9,0,4,8,7,6,5,1,4,3,2,2,1,["java.util.ArrayList/3821976829","...VOImpl/139707113","no_vo.jpg","java.util.HashSet/1594477813","....ResourceImpl/1043766646","","res1","resource 1","id1","test 1","id2","test 2"],0,7] Could you please point me where is the problem and how to fix it. Regards, Marcin Stelmach -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Problem-with-Restlet-client-under-GWT-returns-NULL-tp6313763p6313763.html Sent from the Restlet Discuss mailing list archive at Nabble.com. ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2725488 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2725508

