Not sure about the first problem, but for the second one, try returning a
non-parameterized type, e.g.,

public class PlayerList extends List<Player> {
    // ... whatever constructor you need
}

and then change the @Get signature to

    @Get public PlayerList retrieve() ...

The problem, I think, is that List<Player>, under type erasure, looks like a
raw List, and the deserialization machinery doesn't know what to do with
that. PlayerList, however, can be deserialized because it has the knowledge
that its elements are Players embedded within it.

--tim


On Thu, Jul 21, 2011 at 2:10 PM, Dennis Welu <[email protected]> wrote:

> I'm getting a ResourceException with message of "Length Required (411) -
> Length required". Running JSE client against GAE server project. I was
> running 2.0.8 but have updated to 2.1m5 and still the same results. I have a
> Get and Put working on a different resource, but on this resource the Post
> returns the error above and never gets into the implementation on the
> server.
>
> /**
>  * Players resource interface.
>  */
> public interface PlayersResource {
>
>    @Get
>    public List<Player> retrieve();
>
>    @Post
>    public void store(Player player);
> }
>
> (A second problem is the Get runs on the server fine but on the client it
> always returns null instead of an instance of List<Player>).
>
> Relatively new here...I think from the docs this approach is called
> "internal and transparent serialization" of the transferred objects.
>
> Appreciate any ideas you have. Blown almost a couple days on this now.
>
> Dennis
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2800169
>

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

Reply via email to