Once the ejb method ends the container will also end the associated transaction. Thus making all the entities detached. Then when you try to use variables of the entities which aren't loaded it will throw an LazyInitializationException.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Lazy Initialization Exception with JSF 2 and EJB 3