1 2 3 Previous Next 35 Replies Latest reply: Jul 10, 2006 6:05 PM by rpa_rio Go to original post RSS
  • 30. Re: IOExceptions with MyFaces/Facelets apps
    Clebert Suconic Master

    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 Novice

    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 Novice

    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 Master

    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 Master

     

    "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 Novice

    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.

1 2 3 Previous Next