PDA

View Full Version : paging grid error



witchupan
15 Oct 2008, 8:33 AM
I try to create paging grid and found this error. please help

private Window createTestPagingWindow()
{
Window w = new Window();
w.setClosable(false);
w.setHeading("Test");
w.setResizable(false);
w.setWidth(600);
w.setHeight(300);
w.setLayout(new FitLayout());

RpcProxy proxy = new RpcProxy()
{
@Override
public void load(Object loadConfig, AsyncCallback callback)
{
myService.getPosts((PagingLoadConfig) loadConfig, callback);
}
};

// loader
BasePagingLoader loader = new BasePagingLoader(proxy);
loader.setRemoteSort(true);

loader.load(0, 50);

ListStore<Users> store = new ListStore<Users>(loader);

final PagingToolBar toolBar = new PagingToolBar(50);
toolBar.bind(loader);

List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
columns.add(new ColumnConfig("username", "User", 200));
columns.add(new ColumnConfig("password", "Password", 200));

ColumnModel cm = new ColumnModel(columns);

Grid<Users> grid = new Grid<Users>(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setAutoExpandColumn("username");

ContentPanel panel = new ContentPanel();
panel.setFrame(true);
panel.setCollapsible(true);
panel.setAnimCollapse(false);
panel.setButtonAlign(HorizontalAlignment.CENTER);
panel.setIconStyle("icon-table");
panel.setHeading("Paging Grid");
panel.setLayout(new FitLayout());
panel.add(grid);
panel.setSize(600, 350);
panel.setBottomComponent(toolBar);

w.add(panel);

return w;
}

[ERROR] Uncaught exception escaped
java.lang.RuntimeException: com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Type 'com.extjs.gxt.ui.client.data.BasePagingLoadConfig' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer. For security purposes, this type will not be deserialized.
at com.extjs.gxt.ui.client.store.ListStore.onLoadException(ListStore.java:184)
at com.extjs.gxt.ui.client.store.ListStore$1.loaderLoadException(ListStore.java:135)
at com.extjs.gxt.ui.client.event.LoadListener.handleEvent(LoadListener.java:27)
at com.extjs.gxt.ui.client.event.LoadListener.handleEvent(LoadListener.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:74)
at com.extjs.gxt.ui.client.data.BaseLoader.onLoadFailure(BaseLoader.java:155)
at com.extjs.gxt.ui.client.data.BaseLoader$1.onFailure(BaseLoader.java:115)
at com.extjs.gxt.ui.client.data.RpcProxy$1.onFailure(RpcProxy.java:22)
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:217)
at com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java:254)
at com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.java:226)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:217)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)
Caused by: com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Type 'com.extjs.gxt.ui.client.data.BasePagingLoadConfig' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer. For security purposes, this type will not be deserialized.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:493)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:417)
at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvokeOnWindow(ModuleSpaceIE6.java:67)
at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvoke(ModuleSpaceIE6.java:152)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:447)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:228)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer.instantiate(transient source for com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
at com.google.gwt.dev.shell.ie.MethodDispatch.invoke(MethodDispatch.java:97)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:493)
at org.eclipse.swt.ole.win32.OleAutomation.invoke(OleAutomation.java:417)
at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvokeOnWindow(ModuleSpaceIE6.java:67)
at com.google.gwt.dev.shell.ie.ModuleSpaceIE6.doInvoke(ModuleSpaceIE6.java:152)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:447)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:228)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at DIMS.client.MyService_TypeSerializer.instantiate(transient source for DIMS.client.MyService_TypeSerializer)
at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:114)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:61)
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:199)
at com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java:254)
at com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.java:226)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:217)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:155)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)

gslender
15 Oct 2008, 7:25 PM
where is the myService associated classes relating to the servlet?

the problem could be at the server side - are there any other errors reported anywhere else? like console out or in the tomcat log files? is this hosted or web mode?

cheers,
grant

witchupan
15 Oct 2008, 8:49 PM
My server side is tomcat.

public class MyServiceImpl extends RemoteServiceServlet implements MyService
{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.write("Hello Test");
out.close();
}

public String myMethod(String s)
{
s += " World";
return s;
}

public PagingLoadResult<Users> getPosts(PagingLoadConfig config)
{
List<Users> users = new ArrayList<Users>();
ArrayList<Users> sublist = new ArrayList<Users>();
Users u = new Users();
u.setUsername("test");
u.setPassword("p");
sublist.add(u);
users.add(u);
return new BasePagingLoadResult(sublist, config.getOffset(), users.size());
}
}

[Client]
public interface MyService extends RemoteService
{
public String myMethod(String s);

public PagingLoadResult<Users> getPosts(PagingLoadConfig config);
}

public interface MyServiceAsync
{
public void myMethod(String s, AsyncCallback<String> callback);

public void getPosts(PagingLoadConfig config, AsyncCallback<PagingLoadResult<Users>> callback);
}

[Tomcat Log]
16 ต.ค. 2551 11:53:20 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_07\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Program Files\IDM Computer Solutions\UEStudio '06;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\bea\jdk150_10\bin;C:\Program Files\Common Files\Lenovo;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Common Files\Ahead\Lib\;C:\Program Files\Common Files\Ahead\Lib\
16 ต.ค. 2551 11:53:20 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8088
16 ต.ค. 2551 11:53:21 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8443
16 ต.ค. 2551 11:53:21 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1826 ms
16 ต.ค. 2551 11:53:22 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
16 ต.ค. 2551 11:53:22 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
16 ต.ค. 2551 11:53:23 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "listeners.ContextListener" is already configured for this context. The duplicate definition has been ignored.
16 ต.ค. 2551 11:53:23 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "listeners.SessionListener" is already configured for this context. The duplicate definition has been ignored.
16 ต.ค. 2551 11:53:24 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8088
16 ต.ค. 2551 11:53:24 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8443
16 ต.ค. 2551 11:53:24 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
16 ต.ค. 2551 11:53:24 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/187 config=null
16 ต.ค. 2551 11:53:24 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2976 ms

Thank You.

gslender
15 Oct 2008, 8:59 PM
did you ensure the gwt servlet.jar was included in the tomcat container path?

witchupan
15 Oct 2008, 9:06 PM
yes
in tomcat have WEB-INF\lib\gwt-servlet.jar and gxt.jar.

Thank You.

sachinsurvase
13 Nov 2008, 12:57 AM
yes
in tomcat have WEB-INF\lib\gwt-servlet.jar and gxt.jar.

Thank You.


Hello
I am getting the same error ..... Can u please tell me the solution ?

sachinsurvase

gslender
14 Nov 2008, 4:29 AM
Folks - you can only send GWT serializable objects via RPC.