RPC call returning List<String> fails

10 views
Skip to first unread message

jos

unread,
Jan 15, 2009, 12:36:06 PM1/15/09
to Google Web Toolkit
I have an RPC call with a signature like public List<String> SomeCall
(SomeObj) { return anArrayList; } which failed.
Policy file was deployed and the file had ArrayList, true in the file.
The only real information available was the stack trace it left in
catalina.out (see below).

I'm running gwt1.52, a Spring/Hibernate stack on the back end with (a
probably early version of) gwt-sl. The problem manifested itself in
eclipse. When I changed the return value to String[] eveything worked
fine.

Does anyone know, is it not OK to use List<String> as a return
specifier?




2009-01-14 16:41:08,569 ERROR [org.apache.catalina.core.ContainerBase.
[Catalina].[localhost].[/geo]] - <Exception while dispatching incoming
RPC call>
javax.servlet.ServletException: Client did not send 158 bytes as
expected
at com.google.gwt.user.server.rpc.RPCServletUtils.readContentAsUtf8
(RPCServletUtils.java:148)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.readContent
(RemoteServiceServlet.java:335)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:77)
at org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleRequest
(GWTRPCServiceExporter.java:169)
at
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle
(HttpRequestHandlerAdapter.java:49)
at org.springframework.web.servlet.DispatcherServlet.doDispatch
(DispatcherServlet.java:874)
at org.springframework.web.servlet.DispatcherServlet.doService
(DispatcherServlet.java:808)
at org.springframework.web.servlet.FrameworkServlet.processRequest
(FrameworkServlet.java:476)
at org.springframework.web.servlet.FrameworkServlet.doPost
(FrameworkServlet.java:441)

alex.d

unread,
Jan 16, 2009, 2:30:31 AM1/16/09
to Google Web Toolkit
It is actually. I'm using a lot of structures like this(and more
complex) for data transfer. The problem ist somewhere else - do you
initialize your List properly?

jos

unread,
Jan 17, 2009, 1:22:14 PM1/17/09
to Google Web Toolkit
yes, new ArrayList<String> followed by several add("some string")

What's got me stuck is the backend saying it's waiting on 153 bytes
from the client, like it's not event fired off the RPC call yet

So List<> is OK, I don't need to use ArrayList<> ?

alex.d

unread,
Jan 19, 2009, 3:05:12 AM1/19/09
to Google Web Toolkit
I remember a thread not that long time ago where someone experienced
same trouble with "waiting on NNN bytes". I'm not sure what the
problem exactly was. Using List<String> is ok(but in case of some
black magic used - try it anyway ;-)

jos

unread,
Jan 20, 2009, 11:34:30 PM1/20/09
to Google Web Toolkit
OK, I've finally had a chance to look into this some more and updated
the gwt-sl.jar version I was using (fairly old as previously stated) I
downloaded the 0.1.5b (latest version still using Hibernate4GWT) and
put everything back to List<String> and it worked inside and outside
of eclipse. Given this was the only thing I changed, possibly a
problem in the old library.

Thanks for replies...

jos
Reply all
Reply to author
Forward
0 new messages