PDA

View Full Version : Sending JDO enhanced objects over RPC



brendand
27 Apr 2009, 6:54 PM
I'm running into issues using GAE/J and GWT sending JDO enhanced objects over RPC.

The problem is that the GWT serialization is not compatible with the JDO enhanced POJO objects.

The problem is discussed in detail here. http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_frm/thread/3c768d8d33bfb1dc/5a38aa812c0ac52b?tvc=1#

I know GXT makes lots of things about GWT better, so I was wondering if GXT has a solution here.

One idea was instead of sending enhanced POJO objects over RPC and then converting to ModelData on the client, was to do the ModelData coversion on the server and send that over RPC. Haven't tried it yet.

mask_hot
16 Jun 2010, 3:12 PM
Hi, I think I have a likely issue...

I'm doing a POC of GXT + GAE Datastore and JDO. I have some trouble using a Key type for my primary keys. If I use the Long type, my grids are well loaded but I can't use relationships betweens my JDO POJO. If I use the Key type (mandatory to use relationships) my grids are not loaded. There is no stack trace, my service is well over but I think it should be a trouble with the reader or maybe something else : I saw the DataChanged Event is not fired after the load.

mask_hot
16 Jun 2010, 3:26 PM
I have this :
loaderLoadException
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: The response could not be deserialized

Here is my pojo :


package com.maskhot.fam.model.team;

import java.io.Serializable;

import javax.jdo.annotations.Column;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;


@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Team implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Column(name="key")
private Key key;

@Persistent
@Column(name="code")
private String code;

@Persistent
@Column(name="libelle")
private String libelle;

/**
* @return the id
*/
public Key getKey() {
return key;
}

/**
* @param id the id to set
*/
public void setId(Key key) {
this.key = key;
}

/**
* @return the code
*/
public String getCode() {
return code;
}

/**
* @param code the code to set
*/
public void setCode(String code) {
this.code = code;
}

/**
* @return the libelle
*/
public String getLibelle() {
return libelle;
}

/**
* @param libelle the libelle to set
*/
public void setLibelle(String libelle) {
this.libelle = libelle;
}

public Team( String code, String libelle) {
// super();
this.code = code;
this.libelle = libelle;
}

public Team(){}
}



and



package com.maskhot.fam.model.team;

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

@BEAN(com.maskhot.fam.model.team.Team.class)
public interface TeamBeanModel extends BeanModelMarker {

}