could not initialize proxy - no Session

Error Information:
org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.hibernate.LazyInitializationException: could not initialize proxy - no Session


Error Solution:

1
2
3
4
5
6
7
8
9
10
<!-- filter for keeping session not closed until action completes, "no session" problem -->
<!--this filter should be configurated before the filter for "struts2--filter has operation order" -->
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate5.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>