views:

1028

answers:

1

Hello all,

I've run into a problem I can't figure out and Google search does not return much (I should of thought about posting my question here first ;-).

So I've got a GWT app, that makes a rpc call to a server to save/create a new entity. However, the Spring-Hibernate back-end throws an exception with the following error message:

'attempt to create saveOrUpdate event with null entity'

not sure what that means. What's null?? If it's a new entity I am saving, I am expecting to have the 'id' field be null or say 0 and then have hibernate fill it. right?

+3  A: 

null entity could mean that saveOrUpdate() is actually receiving null as an argument, ie:

session.saveOrUpdate(null);

If you're using serialization to pass to object to a remote location (you mentioned RPC), perhaps you should check if serialization is working correctly. Something tells me that failing to serialize might end up with a null reference being passed.

André Neves
Andre,Both back-end entity and GWT client Entity are serialized.By the way, I can successfully create/save the entity if I run within Eclipse project through Spring beans. But when I run same code from GWT Hosted mode, I get the exception thrown. I can also create/save other entities just fine. weird.
rafael
So you mean this error happens only with this specific entity? saveOrUpdate() on others works fine?
André Neves
Yup. I am starting to thinking it's a rpc proxy issue. See, I have Widget A where I initiate a RPC service. In widget A, I instantiate another widget, widget B. When I do I pass to widget B the RPc service from widget A.
rafael
Andre, thanks for the help. I found what was wrong. I have a code mistake in the code for mapping client gwt entity to back-end entity.
rafael