Wednesday, August 26, 2015

LazyInitializationException when doing RPC on GWT

I need some help with this exception when using GWT. I've read so much about this issue yet I still don't understand why it happens to me. 
The exception is generated when returning a List in the method on the server-side Service Implementation (implementation for doing an RPC call). I'm using Comet: when I want to load data from the database, Comet calls the client-side Service interface method for doing so. 

    gameService.loadArguments(game, player, new AsyncCallback<List<ToulminDTO>>() {
public void onSuccess(List <ToulminDTO> result) {
public void onFailure(Throwable caught) {

As I print a message on the onFailure method, I realize that the problem is when the server-side Service Impl does the "return list". 
I have even done DTO classes for all of the objects that Hibernate saves (as recommended on the GWT guides) but it hasn't solved the issue. What is even more weird is that the exception just happens in some moments. I'm using this on a Game, and in some rounds I am able to load data completely fine, yet in others the exception occurs.
Hope you can help me.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment