In order for lazy loading to work, you have to have the object attached to a session, and the lazy loading must occur inside a transaction.
Either of RockStyle's suggestions will reattach the object to a session.
Then all you have to do is:
Code:
session.beginTransaction();
// Do stuff that requires lazy loading
session.getTransaction().commit();
If the lazy loading occurs in a JSP, you have a few options. You can use scriptlets to reattach the object to the session and surround the lazy loading with a transaction, or you can build some custom tags so that you don't need to use scriptlets. Depending on your setup there may be other solutions, but those are the most straightforward (not necessarily the most elegant or painless solutions, but the easiest ones to test that you can get lazy loading to work).