Exception while dispatching incoming RPC call

107 views
Skip to first unread message

Thad

unread,
Oct 7, 2008, 3:47:03 PM10/7/08
to Google Web Toolkit
My GWT application is using a native function to call another GWT app
embedded in my main app:

native JavaScriptObject openWindow(String param) /*-{
$wnd.open('./ProjectB.html?param='+param, '_blank');
return true;
}-*/;

The ProjectB window opens and it's app runs perfectly. However, I get
an error alert, "call failed on server". Why?

The error is coming from GTW, as Tomcat's localhost logfile shows

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java:
617)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readInt(ServerSerializationStreamReader.java:
432)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.prepareToRead(AbstractSerializationStreamReader.java:
38)
...

(I asked this late last Friday. Maybe no one knows why this error
comes up, maybe it but I'm desperate to find a solution. There more
details at http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/e8e7924527a4a1d4#).

askar

unread,
Oct 10, 2008, 6:55:43 AM10/10/08
to Google Web Toolkit
We are facing the very same problem.

Sumit Chandel

unread,
Oct 14, 2008, 4:14:33 PM10/14/08
to Google-We...@googlegroups.com
Hi Thad,

Is there any reason why you couldn't package up ProjectB and use it directly in code in ProjectA? That would make it so that your application would load up much faster as it would be a single monolithically compiled and optimized script and would also reduce the number of HTTP roundtrips required to load the application.

What's more, you would be able to debug your application in hosted mode and trace through both your ProjectA and ProjectB code to more easily identify where the problem is occurring.

As for the cause behind the problem you're facing in the current setup, I can't really say what's going wrong. What I would suggest is starting your Tomcat server in debug mode so that you can at least debug the server-side code to try and find out where the IndexOutOfBoundsException is occurring. Another thing I would suggest is checking the path from which your application resources are being served, most especially that the ProjectB application resources (.js files, etc...) are all being served from the same relative paths as they are when ProjectB is working in a standalone setup.

Hope that helps,
-Sumit Chandel

Thad

unread,
Oct 27, 2008, 3:06:03 PM10/27/08
to Google Web Toolkit
Yes, this is the way I'm going to have to do it. I've written other
parts of my application this way and think I can blunder my way
through it again (my first attempt was a while back, and at the time I
lucked into the right magic for two *.gwt.xml files--one with an entry
point for testing, one without for integration).

What I had hoped for, though, was a separate application so it could
be opened in a separate window. In my case, the user is retrieving
images from a database hitlist and I wanted the capability to open
multiple images--say up to 4--and tile them on the screen for
comparison. I can do this easily if the new window is a JSP call, but
I want a GWT app and I want it to run from the same webapp as it's
parent so it can share the servlet context (I read in Tomcat docs that
this can be shared across apps, but it's considered bad for security).

I like GWT very much, but I find the single browser window
constraining. If there is another way to do it, I need to see an
example. As for windowing within my application inside the browser
window, I've found current solutions too slow, too limited, and/or too
complicated to use.

On Oct 14, 4:14 pm, "Sumit Chandel" <sumitchan...@google.com> wrote:
> Hi Thad,
> Is there any reason why you couldn't package up ProjectB and use it directly
> in code in ProjectA? That would make it so that your application would load
> up much faster as it would be a single monolithically compiled and optimized
> script and would also reduce the number of HTTP roundtrips required to load
> the application.
>
> What's more, you would be able to debug your application in hosted mode and
> trace through both your ProjectA and ProjectB code to more easily identify
> where the problem is occurring.
>
> As for the cause behind the problem you're facing in the current setup, I
> can't really say what's going wrong. What I would suggest is starting your
> Tomcat server in debug mode so that you can at least debug the server-side
> code to try and find out where the IndexOutOfBoundsException is occurring.
> Another thing I would suggest is checking the path from which your
> application resources are being served, most especially that the ProjectB
> application resources (.js files, etc...) are all being served from the same
> relative paths as they are when ProjectB is working in a standalone setup.
>
> Hope that helps,
> -Sumit Chandel
>
> >http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...
> > ).
Reply all
Reply to author
Forward
0 new messages