PDA

View Full Version : Send BeanModel.getBean() through RPC generates NullPointer



brginfo05
8 Jun 2009, 6:17 AM
GWT 1.6.4
GXT 2.0m2

When a i create a BeanModel on the cliente and try to send it to the server i get a NullPointerException. I've debugged the code, the bean works fine, the problem occurs when call the service.

Create the BeanModel. I use a formBinding to bind the data and it works fine.


BeanModelFactory factory = BeanModelLookup.get().getFactory(bean.getClass());
data = factory.createModel(bean);
Dispatch the event using mvc


AppEvent event = new AppEvent(XXXEvents.Save);
event.setData(SERVICE, service);
event.setData(DATA, data);

Dispatcher.get().dispatch(event);
Up to this point my bean works fine and has some values. But when i execute the service the server throws a NullPointerException.


BeanModel data = event.getData(DATA);
RemovalServiceAsync service = event.getData(SERVICE);

service.remove((BeanModelTag) data.getBean(), new AsyncCallback<Boolean>() {...}

brginfo05
8 Jun 2009, 6:19 AM
The code is working. When fill my Grid store, get the BeanModel from that store and execute the code above it works fine.