[Resolvido] -Objectify roda localmente mas não roda no GAE

Ao rodar a aplicação no Gae apresenta o erro no servidor ( Erro 500 )
Visualizando o log encontrei a mensagem
( Caused by: java.io.NotSerializableException: com.googlecode.objectify.impl.ObjectifyImpl )

Minha aplicação é bem simples segue o exemplo das classes utilizadas

Entidades

public class BaseEntidade implements Serializable{ @Id @GeneratedValue(strategy=GenerationType.SEQUENCE) private Long id; public Long getId() { return id; } public void setId(Long id) { this.id = id; } }

public class Cliente extends BaseEntidade{
    private String nome;
    public String getNome() {
        return nome;
    }
    public void setNome(String nome) {
        this.nome = nome;
    }
    @Override
    public String toString() {
        return this.nome;
    }
}[/code]

Exemplo de Dao

[code]import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.Query;
import com.googlecode.objectify.util.DAOBase;
import entidades.Cliente;
import java.io.Serializable;
import java.util.List;

public class ClienteDao extends DAOBase implements Serializable {

    private Objectify ofy;

    public ClienteDao() {
        ObjectifyService.register(Cliente.class);
        this.ofy = ObjectifyService.begin();
    }

    public void salvar(Cliente obj) {
        ofy.put(obj);
    }
    public Cliente carrega(Long id) {
        return ofy.get(Cliente.class, id);
    }
    public void excluir(Cliente obj) {
        ofy = ObjectifyService.begin();
        ofy.delete(obj);
    }
    public List<Cliente> listar() {
        Query<Cliente> q = ofy.query(Cliente.class);
        return q.list();
    }
}[/code]
Exemplo do controller

[code]@SessionScoped
@ManagedBean(name="ClienteC")
public class ClienteController implements IController, Serializable{
    private Cliente cliente;
    private ClienteDao daoCliente;
    public ClienteController() {
        daoCliente = new ClienteDao();
    }
    public Cliente getCliente() {
        return cliente;
    }
    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }
    public List<Cliente> getClientes(){
        return daoCliente.listar();
    }
    //////////////////////////////////////////////////////////////////////////
    public String alterar(){
        return "/clientes/form";
    }
    public String salvar(){
        daoCliente.salvar(cliente);
        return this.listar();
    }
    public String novo(){
        cliente = new Cliente();
        return this.alterar();
    }
    public String excluir(){
        daoCliente.excluir(cliente);
        return this.listar();
    }
    public String listar() {
        return "/clientes/lista";
    }
}

Quando eu clico no botão novo

ele exibe a mensagem de erro mencionada acima

Estou utilizando o Objectify 3.1

também estou utilizando o primefaces 3.0.1 mas acho que isso não está influenciando no erro

Alguém já passou por esse erro ?

Tente alterar a linha:

para:

E passe a chamar o ObjectifyService.begin() dentro de cada método.

O problema é que o seu ClienteController é serializado e ele referencia indiretamente Objectify.

Muito Obrigado J2Alex !

funcionou perfeitamente!

Obrigado mesmo