public interface QueryService extends RemoteService
{
/**
* @gwt.typeArgs <com.ge.taxlocid.client.CityBean>
*/
public List searchLocations(String query);
public String searchLocationsString(String query);
}
You'll notice two methods. The second method (searchLocationsString)
is meant to be a debug-only wrapper around searchLocations, which
simply calls toString on the resulting list object. I was able to
ascertain that this works all the way through back to the client. At
that point I moved on to calling searchLocations in an attempt to
retrieve the actual list object.
Notice the typeArgs annotation specifying the result to be a list of
CityBean objects. The hierarchy of that class is as follows:
StateBean implements IsSerializable
^
|
CountyBean implements IsSerializable
^
|
CityBean implements IsSerializable
I wasn't sure if IsSerializable lost its magical powers similar to
Serializable upon subclassing, so I made each class explicitly
implement it.
Based on the server logs, I do know that the RPC servlet is in fact
receiving the call, performs the query and gets the right objects,
just as it did with searchLocationsString. So the only unknown is
what happens when that servlet hands the resulting object off to the
transport layer. Here's what the client code looks like:
protected void search()
{
QueryServiceAsync queryServiceProxy =
(QueryServiceAsync)GWT.create(QueryService.class);
String serviceEntryPoint = GWT.getModuleBaseURL() + "query";
((ServiceDefTarget)queryServiceProxy).setServiceEntryPoint(serviceEntryPoint);
queryServiceProxy.searchLocations(this.locIDInput.getText(),
this.searchCallback);
}
As the subject of this post states, I keep getting
IncompatibleRemoteServiceException on the client. Any thoughts? Oh
and I did see the post about Boolean problems and the bean classes do
not have any boolean or Boolean fields.
String serviceEntryPoint = GWT.getModuleBaseURL () + "query";
((ServiceDefTarget)queryServiceProxy).setServiceEntryPoint(serviceEntryPoint);
queryServiceProxy.searchLocations(this.locIDInput.getText(),
this.searchCallback);
}
As the subject of this post states, I keep getting
IncompatibleRemoteServiceException on the client. Any thoughts? Oh
and I did see the post about Boolean problems and the bean classes do
not have any boolean or Boolean fields.
On Jun 20, 2:56 pm, "Miguel Méndez" <mmen...@google.com> wrote:
> Hi Alexey,
>
> When the client receives a type from the server that it cannot deserialize
> it will treat it as an IncompatibleRemoteServiceException.
>
> What is the concrete type of the List that you are returning? If it is not
> an ArrayList or Vector proper then that is most likely the source of the
> problem. Our client-side JRE only supports ArrayList and Vector.
>
> People usually run into this problem by returning the result of calling
> Arrays.asList(...). If it is an ArrayList or Vector proper there maybe an
> issue with the CityBean.
>
> BTW, you only need to have IsSerializable once in your class hierarchy.
>
> HTH,
>
It doesn't always fail at the same point either. One person had
trouble accessing the initial menu, other users couldn't register a
particular data entity, so it's quite random.
I never had a problem yet with Firefox, so it seems to be IE-specific
(IE7).
G>
On Jun 20, 4:08 pm, "Miguel Méndez" <mmen...@google.com> wrote:
> We need to clamp these off at the server. Although, it will require
> additional work on the server to make it a 100% solution.
>
--
Miguel