Hibernate wraps Java objects with Proxies so that these proxies get a chance to intercept your getter/setter calls and, if the object is only a shell object with an id, hibernate proxy will go to the database, load the object, and then the calling code will get the data it was asking for. In order for this 'magic' to happen, the Hibernate object must be attached to a Hibernate session (a Java JDBC connection must be around for access to the database).
If you are trying to serialize objects that are of a 'Hibernate nature' (HOJO's), you need to make sure that the objects you are serializing out are completely loaded. That means you would need to walk through the object graph and ensure that it is loaded. This is where the Hibernate model breaks down in general (I never recommend using Hibernate). Your object graph needs to be completely self-contained (if it has just one pointer to another object that is not loaded, then you won't be able to serialize the object graph).
Most apps sent Data Transfer Objects (DTO's) to receiving clients and these DTO objects are either java.util.Map instances or actual Java POJO's with only properties (optional setter / getters on them), and no behavior. The data is copied from the HOJO's to the DTOs, while the Hibernate objects are in session. The DTO's are then what is serialized out as the return value (say in an server response to an Ajax call).
John