Hi all.

I have searched the forum and google for some answers, but have been
unable to find a direct answer to my question. So sorry if this has
been answered. In that case, please give me the link to that
discussion.

I'm working on a project where I need to send lots of different data
object over RPC to save them in a database.
I thought, hey let's use some generics and let the type extends
Serializable.

So I defined the synchronous method like this:

<T extends Serializable> DBQueryResult<T> saveObject(T aObject);

and asynchronous version:

<T extends Serializable> void saveObject(T aObject,
AsyncCallback<DBQueryResult<T>> callback);

All data types that I pass to this method implements Serializable and
I have verified that they can be sent when defining separate methods
for them. DBQueryResult has also been successfully serialized and
deserialized before I tried to make this generic.

I get no compilation errors, but during runtime (in hosted mode)I get
the following error:

2009-okt-08 10:21:42
com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: [1254997302431000] javax.servlet.ServletContext log:
DataServiceImpl: An IncompatibleRemoteServiceException was thrown
while processing this call.
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException:
This application is out of date, please click the refresh button on
your browser. ( Could not locate requested method 'saveObject
(java.io.Serializable)' in interface
'com.borglin.web.teamsite.client.servercomm.DataService' )
        at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:293)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:164)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
        .....


Is it not possible to use generics when defining RPC methods? Is there
any other way to avoid having to define separate methods for each data
object that I need to send over?

Thanks in advance!

BR, Andreas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to