1 Reply Latest reply on Mar 25, 2008 3:26 AM by rey bumalay

    smart clone from jboss serialization library causes lazy initialization exception

    rey bumalay Newbie

      i have a clone util method that uses jboss serialization's smartClone method. heres the code:



      public Object cloneObject(Object input) {
                try {
                     JBossObjectOutputStream jbossSerializer = new JBossObjectOutputStream(null);
                     Object obj = jbossSerializer.smartClone(input);
                     return obj;
                }
                catch(Exception e) {
                     System.out.println("EXCEPTION CAUGHT: " + e.getMessage());
                     return null;
                }
           }




      but when i invoked that method, an exception saying something like failed to lazily initialize a collection of role: ... is thrown.


      i'm not sure if this is a bug or i misused the serialization library