views:

227

answers:

1

GWT version: 2.0.0
Grail version: 1.1.2
Grails - GWT plugin version: grails-gwt-0.5-SNAPSHOT, used after 0.4.1

I'm calling a method from the gwt side passing a transfer object, which implements IsSerializable and resides in the client package, so to be compiled into js, also all class properties are of primitive types.
Follows a brief stack trace (if you need more I'll just copy all of it):

ERROR /myapp  - Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException:
Parameter 0 of is of an unknown type 'com.lazywithclass.client.rpc.ComponentTo'
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:286)
at com.google.gwt.user.server.rpc.RPC$decodeRequest.call(Unknown Source)

Caused by: java.lang.ClassNotFoundException:
com.lazywithclass.client.rpc.ComponentTo
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)

The transfer object is in the rpc package, i've put it there out of desperation, originally it was in the package where it is used.
I tested the rpc without the parameter and all goes well, I'm tempted to go the rest-way as Jan Ehrhardt suggested here, but before this I would like to know what I'm doing wrong.
When I was using gwt without grails I used to convert the transfer object from client to server in the servlet (the *Impl class), now I'm a bit confused where to do it, any ideas? Is this a project configuration issue?

Thank you in advance

A: 

I solved this, my transfer object was in the client side, and this is wrong from what I've understood. It has to be in a place where it can be reached from the client and from the server, because it is used from both.
I wrote a post on this and made a sample project to explain how I did it, I hope that will help someone else.

Alberto Zaccagni