PDA

View Full Version : BeanModelFactory stopped working 2.0.1 -> 2.1.0



pierand
8 Jan 2010, 2:47 AM
I am using 4 bean classes, each with their own BeanModel that extends BeanModelMarker. On upgrading from 2.0.1 to 2.1.0 I find that I now get a 'No BeanModelFactory found for class ' exception. The classes are simple beans, with just setters and getters, and each has an idenitical BeanModel such as :


package com.cybersonic.nurserymaster.client.data.model.beans;


import com.extjs.gxt.ui.client.data.BeanModelMarker;

import com.extjs.gxt.ui.client.data.BeanModelMarker.BEAN;


@BEAN(com.cybersonic.nurserymaster.common.beans.BookingDTO.class)

public interface BookingDTOBeanModel extends BeanModelMarker {

}

getaceres
15 Jan 2010, 7:03 AM
I've got the same problem. I have some beans marked with BeanModelMarker interface that were working in GXT 2.0.1 and now they don't work in GXT 2.1.0

In my case, I have this bean:


import com.project.ExtBean;
import com.extjs.gxt.ui.client.data.BeanModelMarker;
import com.extjs.gxt.ui.client.data.BeanModelMarker.BEAN;

@BEAN(ExtBean.class)
public interface ExtBeanModel extends BeanModelMarker {

}


If I do:


BeanModelLookup.get().getFactory(ExtBean.class)

in my code, I get a bean factory and I can get models from my beans.

Now, I have a grid with a PagingModelMemoryProxy proxy to paginate over a static list of beans. In the load, the grid is correctly populated but when I press the 'go to next page' button, I get this exception:


No BeanModelFactory found for class com.project.BeanModel_com_project_ExtBean
at com.extjs.gxt.ui.client.data.BeanModelReader.read(BeanModelReader.java:69)
[ERROR] at com.extjs.gxt.ui.client.data.BeanModelReader.read(BeanModelReader.java:1)
[ERROR] at com.extjs.gxt.ui.client.data.PagingModelMemoryProxy.load(PagingModelMemoryProxy.java:46)
[ERROR] at com.extjs.gxt.ui.client.data.BaseLoader.loadData(BaseLoader.java:134)
[ERROR] at com.extjs.gxt.ui.client.data.BaseLoader.load(BaseLoader.java:98)
[ERROR] at com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar.doLoadRequest(PagingToolBar.java:678)
[ERROR] at com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar.next(PagingToolBar.java:597)
[ERROR] at com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar$4.componentSelected(PagingToolBar.java:410)
[ERROR] at com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar$4.componentSelected(PagingToolBar.java:1)
[ERROR] at com.extjs.gxt.ui.client.event.SelectionListener.handleEvent(SelectionListener.java:20)
[ERROR] at com.extjs.gxt.ui.client.event.SelectionListener.handleEvent(SelectionListener.java:1)
[ERROR] at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:178)
[ERROR] at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:86)
[ERROR] at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:448)
[ERROR] at com.extjs.gxt.ui.client.widget.button.Button.onClick(Button.java:577)
[ERROR] at com.extjs.gxt.ui.client.widget.button.Button.onComponentEvent(Button.java:285)
[ERROR] at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:820)
[ERROR] at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1307)
[ERROR] at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1263)
[ERROR] at sun.reflect.GeneratedMethodAccessor696.invoke(Unknown Source)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:585)
[ERROR] at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
[ERROR] at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
[ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
[ERROR] at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
[ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
[ERROR] at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
[ERROR] at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
[ERROR] at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
[ERROR] at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
[ERROR] at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
[ERROR] at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
[ERROR] at sun.reflect.GeneratedMethodAccessor693.invoke(Unknown Source)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:585)
[ERROR] at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
[ERROR] at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
[ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
[ERROR] at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
[ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
[ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
[ERROR] at java.lang.Thread.run(Thread.java:595)


I'm using GXT 2.1.0 and GWT 2.0.0