• Post Reply Bookmark Topic Watch Topic
  • New Topic

could not initialize proxy - the owning Session was closed

 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I know that this error has already been discussed before, but I couldn't find any situation equals to mine.
Honestly, it seems to me being a bug or generic error throws by Hibernate for somehow.

I'm trying to call an ejb running on JBoss 4.0.5 from a web service jax-ws client. I understand the call comes from out the container but I don't know why the session is closed before the bean returns the data.

Here's the client code:


the ejb method


the entity


the error displayed on JBoss
10:38:30,791 ERROR [LazyInitializationException] could not initialize proxy - the owning Session was closed
org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed


Thanks in advance.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, is there more mapping that what is displayed, like is there something in the ServiceStop class.

I believe that your exception is being thrown when this line it executing

System.out.print(stop);

Somehow the toString of stop is trying to progress deeper into the object, that is loaded, and then it tries to load and gives the lazyInitializationException.

First try to just printout the stop.location. then try printing stop.serviceStop.size()

I am thinking those will work.

Mark
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!