I want to use OpenEntityManagerInViewFilter
to be able to avoid lazyinitialization loading. This is my web.xml configuration:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/mvc-dispatcher-servlet.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
I am still getting the exeption:
Servlet.service()
for servlet [mvc-dispatcher
] in context with path [/...] threw exception
Request processing failed; nested exception is
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: ..., could not initialize proxy - no Session] with root cause
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: ...., could not initialize proxy - no Session
Anybody know what am I doing wrong?