Cocould not initialize proxy-No session Solution
Error message:
Stacktraces
Org. Apache. Jasper. jasperexception: cocould not initialize proxy-No session-class: org. hibernate. Proxy. abstractlazyinitializer file: abstractlazyinitializer. Java method:
Initialize line: 167-ORG/hibernate/Proxy/abstractlazyinitializer. Java: 167:-1
Cocould not initialize proxy-No session-class: Org. hibernate. proxy. abstractlazyinitializer file: abstractlazyinitializer. java method: Initialize line: 167-ORG/hibernate/Proxy/abstractlazyinitializer. java: 167:-1
Solution
Add a filter to Web. xml
<Filter>
<Filter-Name> opensessioninview </filter-Name>
<Filter-class> org. springframework. Orm. hibernate3.support. opensessioninviewfilter </filter-class>
</Filter>
<Filter-mapping>
<Filter-Name> opensessioninview </filter-Name>
<URL-pattern>/* </url-pattern>
</Filter-mapping>
Note: This filter must be before struts filter; otherwise, an error is returned.
Cause: the session is closed before you access it.