Dave Perrett

Appfuse "Failed to Lazily Initialize a Collection of Role"

appfuse, database, java, programming, quickie, 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 .

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