erroneous "call failed on server" when servlet is successful

10 views
Skip to first unread message

Thad

unread,
Oct 3, 2008, 6:43:28 PM10/3/08
to Google Web Toolkit
I have two GWT projects, call them ProjectA and ProjectB, that I would
like to keep separate. When ProjectA.war file is created, I'm
integrating ProjectB as a subproject. Eventually, there may be
multiple subprojects inside ProjectA, and ProjectB may also be used as
a subproject elsewhere.

In my integrated projects, anchors in ProjectA can now call "./
ProjectB.html?foo=bar" without creating a new HttpSession, which is
grand because ProjectA already holds a login and license on a remote
application and database, and can share this seemlessly with
ProjectB. That part works fine.

On load, a servlet call starts in ProjectB to attach to the database
and pull up a file. It all works just like when ProjectB runs
standalone, EXCEPT I always get an alert with the message "The call
failed on the server; see server log for details". Tomcat's
localhost.log shows "java.lang.IndexOutOfBoundsException: Index: 0,
Size: 0". (The full trace is at the end of this message.) This exact
same message occurs again when ProjectB makes a servlet call, although
otherwise the call is behaves correctly.

My distrib directory for ProjectA looks like a normal GWT distribution
directory. I then insert ProjectB (using Robert Hanson's "GWT in
Action" Ch 16 as a guide). I get this:

ProjectA
--distrib
--**.cache.html, etc
--ProjectA.html
--ProjectA.css
--ProjectB.html
--ProjectB.css
--ProjectB
--**.cache.html, etc
--WEB-INF
--classes
--lib
--web.xml

I have merged the web.xml files of both projects as well as the
classes and lib directories. In web.xml, servlets from ProjectA look
like

<servlet-mapping>
<servlet-name>aServices</servlet-name>
<url-pattern>/servlet/aServices</url-pattern>
</servlet-mapping>

While ProjectB looks like

<servlet-mapping>
<servlet-name>bServices</servlet-name>
<url-pattern>/ProjectB/servlet/bServices</url-pattern>
</servlet-mapping>

Any ideas what's happening? You can see from the message below that
the error seems to be coming from GWT.

Oct 3, 2008 6:16:48 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
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)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:
383)
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:234)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
163)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
263)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:
190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:
283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:
697)
at org.apache.jk.common.ChannelSocket
$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Reply all
Reply to author
Forward
0 new messages