“Appfuse “failed to lazily initialize a collection of role”":/blog/2007/11/27/appfuse-failed-to-lazily-initialize-a-collection-of-role

Filed under appfuse, database, java, programming, quickie, and web.

If you are getting a failed to lazily initialize a collection of role error in AppFuse , you need to un-comment the lazyLoadingFilter filter and associated filter-mapping in src/main/webapp/WEB-INF/web.xml .

<filter>
    <filter-name>lazyLoadingFilter</filter-name>
    <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>lazyLoadingFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

If you enjoyed this post, please follow us on twitter or subscribe to our feed!