I need to know what caused it.
A regular null reference should be treated without any problem.
This is my Cidade.java:
package br.gov.go.tj.execpen.entidades;
import java.io.Serializable;
public class Cidade implements Serializable
{
static final long serialVersionUID = 1l;
private Integer codigo;
private String nome;
private String uf;
public Cidade() {
}
public Integer getCodigo() {
return(codigo);
}
public void setCodigo(Integer codigo) {
this.codigo = codigo;
}
public String getNome() {
return(nome);
}
public void setNome(String nome) {
this.nome = nome;
}
public String getUf() {
return uf;
}
public void setUf(String uf) {
this.uf = uf;
}
}
and when the error happens all fields are null.
Clebert,
Sorry, i checked here and this is a Hibernate related issue that was causing that error.
The problem won't be on Cidades. The problem will be on the class holding Cidades.
Again... can't you send me the whole thing in private?
clebert.suconic at jboss.com
I won't of course publish anything.
Clebert
"rpa_rio" wrote:
Clebert,
Sorry, i checked here and this is a Hibernate related issue that was causing that error.
Well, i have two methods on Hibernate that loads a persistent instance from database, the first method Session.load that i was using retrieve an existing persistence instance but this isn't appropriate in case where i need check if the instance exists in database.
So, when i use this method and the instance doesn't exists in database, then i get a instance with null values in all instance fields and this was causing the error on jboss serialization.
Now i'm using Session.get, this method returns null if the instance doesn't exists in database and when jboss serialization executes the code everything works fine because you do some checks about null pointers.