PDA

View Full Version : IncompatibleRemoteServiceException error thrown using paging grid



blackbox23
13 Jan 2010, 6:29 AM
Hello,

I get the following error when trying to load custom model to a paging grid using spring framework.

The custom model is packaged into a separate jar file which I inherit in my *.gwt.xml.

I only encounter the error on paging grid. the custom model is sent over the wire and displayed properly whn not using paging grid.

Ive already cleared my cache, recompile and rebuilt war, redeployed but still the exception is thrown in dev hosted mode and when using the browser.

Hope someone can help me out with this.

Using:

GWT 2.0
GXT 2.1.0

Error:

SEVERE: An IncompatibleRemoteServiceException was thrown while processing this call.
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.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:308)
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:166)
:
:

Code:

web.xml



<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
<servlet-name>control</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>control</servlet-name>
<url-pattern>*.rpc</url-pattern>
</servlet-mapping>



applicationContext.xml



<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>

<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg ref="dataSource"/>
</bean>

<bean id="fileDefinitionPOJODao" class="com.concept.test.core.dao.implementation.FileDefinitionPOJODaoImpl">
<property name="dataSource" ref="dataSource"/>
</bean>


control-servlet.xml



<!-- Maps the request through to a concrete controller instance -->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/**/quote.rpc=FileManagementExController
</value>
</property>
</bean>


<!-- GwtRpcController wraps our service in order to decode the incoming -->
<!-- request then delegates processing of the call to the POJO service -->
<!-- and then encodes the return value forwarding the response. -->
<bean id="fileManagementExController" class="com.concept.proto.control.server.controller.GwtRpcController">
<property name="remoteService">
<!-- <bean class="com.concept.proto.control.server.FileManagementExServiceImpl" /> -->
<bean id="fileManagementExServiceImpl1" class="com.concept.proto.control.server.FileManagementExServiceImpl">
<property name="p" ref="fileDefinitionPOJODao"></property>
</bean>
</property>
</bean>



FileDefinitionModel.java



package com.concept.proto.control.common.models;

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

@BEAN(com.concept.test.core.models.FileDefinitionPOJO.class)
public interface FileDefinitionModel extends BeanModelMarker {
}





FileDefinitionPOJO.java


package com.concept.test.core.models;

import java.io.Serializable;



public class FileDefinitionPOJO implements Serializable {
private int id;
private String name;
private String file;
private int testType;

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getFile() {
return file;
}

public void setFile(String file) {
this.file = file;
}

public int getTestType() {
return testType;
}

public void setTestType(int testType) {
this.testType = testType;
}

}



App.java



service = (FileManagementExServiceAsync) GWT
.create(FileManagementExService.class);

this.loader = new BasePagingLoader<PagingLoadResult<ModelData>>(
this.proxy, reader);

this.loader.setSortField("name");
this.loader.setRemoteSort(true);
this.store = new ListStore<BeanModel>(this.loader);


protected final RpcProxy<PagingLoadResult<FileDefinitionPOJO>> getProxy(
final FileManagementExServiceAsync service) {
RpcProxy<PagingLoadResult<FileDefinitionPOJO>> proxy = new RpcProxy<PagingLoadResult<FileDefinitionPOJO>>() {
@Override
public void load(
final Object loadConfig,
final AsyncCallback callback) {

DeferredCommand.addCommand(new Command() {
public void execute() {
service.getFiles((BasePagingLoadConfig) loadConfig,
callback);

}
});

:
:
:



Services:

FileManagementExService.java



package com.concept.proto.control.common.services;
import java.util.ArrayList;
import java.util.List;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.concept.test.core.models.FileDefinitionPOJO;
@RemoteServiceRelativePath("quote.rpc")
public interface FileManagementExService extends RemoteService {

Arno.Nyhm
15 Jan 2010, 8:40 AM
did you solved your problem whith this thread?


... I don't know if I would be able to solve this without your solution above! Now everything works great!
http://www.extjs.com/forum/showthread.php?p=427141#post427141

blackbox23
17 Jan 2010, 10:04 PM
Yes Arno. I got it working using the sample from this thread.

http://www.extjs.com/forum/showthrea...141#post427141 (http://www.extjs.com/forum/showthread.php?p=427141#post427141)