struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hezjing <>
Subject Configuring OpenSessionInViewInterceptor as S2's interceptor
Date Wed, 22 Aug 2007 08:39:14 GMT

I'm encountering this exception (when trying to iterate a list of
orders for a specific customer in JSP),

failed to lazily initialize a collection of role:
com.dummy.Customer.orders, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(
at org.hibernate.collection.AbstractPersistentCollection.initialize(
at org.hibernate.collection.PersistentBag.iterator(
at org.apache.struts2.util.MakeIterator.convert(

I'm using Struts 2, Hibernate and Spring (for creating actions, DAOs and etc).

I read that Spring's OpenSessionInViewInterceptor will resolve this
problem but can you describe how to configure
OpenSessionInViewInterceptor in Struts2?

And, is there a better alternative than using OpenSessionInViewInterceptor?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message