Page 1 of 1

LazyInitializationException OpenSessionInViewFilter

PostPosted: Wed Jul 27, 2011 2:33 pm
by haretu
if used OpenSessionInViewFilter in web.xml, still has LazyInitializationException.
need fix like the following, move the following the block to the top of web.xml. before struts2 dispatcher filter

<filter>
<filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
<filter-class>
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter
</filter-class>
</filter>

<filter-mapping>
<filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>