Sunday, February 28, 2010

problem with serialization of uninitialized JPA 2 annotated entities (gwt 2.0.3)

Hi,

maybe my problem is related to http://code.google.com/p/google-web-toolkit/issues/detail?id=4140

The gwt remote call to the following service works for getUser1() but
fails for getUser2():

@Service("testService")
public class TestServiceImpl implements TestService {

public User getUser1() {
User u = new User();
u.setGroups(new HashSet<Group>());
u.setId(0);
u.setPassword("pw");
u.setUsername("name");
return u;
}

public User getUser2() {
return new User();
}
}

User is a simple JPA annotated entity. I'm using gwt 2.0.3, JPA 2,
spring 3.0.1 and the GWTSpringController of gwt-sl 1.0. Before
switching to gwt 2.0 everything worked fine.

This is the exception thrown:

Something other than an int was returned from JSNI method
'@com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader::readInt()':
JS value of type undefined, expected int
com.google.gwt.dev.shell.HostedModeException: Something other than an
int was returned from JSNI method
'@com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader::readInt()':
JS value of type undefined, expected int at
com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144) at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:
242) at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:
75) at
com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.readInt(ClientSerializationStreamReader.java)
at
com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.readString(ClientSerializationStreamReader.java:
107) at
net.anwaltsdatenbank.adb.client.domain.jforum.User_FieldSerializer.deserialize(User_FieldSerializer.java:
42) (...)


Hope someone can help here.

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate