-
30. Re: IOExceptions with MyFaces/Facelets apps
clebert.suconic Jul 10, 2006 3:30 PM (in response to rpa_rio)I need to know what caused it.
A regular null reference should be treated without any problem. -
31. Re: IOExceptions with MyFaces/Facelets apps
rpa_rio Jul 10, 2006 3:50 PM (in response to rpa_rio)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. -
32. Re: IOExceptions with MyFaces/Facelets apps
rpa_rio Jul 10, 2006 4:01 PM (in response to rpa_rio)Clebert,
Sorry, i checked here and this is a Hibernate related issue that was causing that error. -
33. Re: IOExceptions with MyFaces/Facelets apps
clebert.suconic Jul 10, 2006 4:03 PM (in response to rpa_rio)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 -
34. Re: IOExceptions with MyFaces/Facelets apps
clebert.suconic Jul 10, 2006 4:06 PM (in response to rpa_rio)"rpa_rio" wrote:
Clebert,
Sorry, i checked here and this is a Hibernate related issue that was causing that error.
now that I spent some time on it I'm curious... :-)
Can you point me what's the issue? -
35. Re: IOExceptions with MyFaces/Facelets apps
rpa_rio Jul 10, 2006 6:05 PM (in response to rpa_rio)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.