Could you please provide full stacktrace and may be some small example?
And which Hibernate Tools do you use? I can't reproduce this with my example.
The problem is that my object does have a field that uses lazy instantiation (not eagerly fetched).
It appears the hibernate tool calls the toString() method on my object, which tries to invoke this field and thus the error.
To work around i just changed my toString for now so it doesn't access this field.
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.sas.workflow.engine.mediation.hibernate.HibProcess.subprocesses, no session or session was closed