6 Replies Latest reply on Mar 10, 2010 3:51 PM by get boa

    javassist.JavassistLazyInitializer exception when Querying

    get boa Newbie

      Hi y'all,

      I'm struggling to solve this lazy issue I hope you guys could help me out.
      This is how i'm trying to do the query:


      AuditReader reader = AuditReaderFactory.get(hibernateSession);

      AuditQuery query = reader.createQuery().forRevisionsOfEntity(Product.class, false, false);



      query.add(AuditEntity.revisionProperty("date").between(dataInicialTmp.getTime(), dataFinalTmp.getTime()));
      List list = query.getResultList();


      the intention of this query is to get all products with the given situation per sector in a range of date


      If i call the System.out.println(list.size()); of this list it shows the real result, but when trying to show the results on my page, an exception is thrown:





      public class Product implements Serializable{


                  private Box box;

                  private Sector sector;




                  public Box getBox() {

                        return box;



                  public void setBox(Box box){

                          this.box = box;



                  public Sector getSector() {

                        return sector;


                  public void setSector(Sector sector){

                          this.sector = sector;






      public class Box implements Serializable{


                  @OneToMany(mappedBy = "box")

                  private Set<Product> products;


                   // getters and setters



      Any idea of what i'm doing wrong ??? Any comments/ideas are welcome
      thanks in advance