1. Lazy Loading
Because of the load lazy loading mechanism at this time, the session is closed when the JSP page sends the SQL statement. So I will report the above mistakes. You can add a filter so that the session closes after the request response is complete.
The filter is to be configured in front of the struts2 filter. The filters are configured as follows:
<filter> <filter-name>OpenSessionInViewFilter</filter-name> <filter-class >org.springframework.orm.hibernate4.support.opensessioninviewfilter</filter-class> </filter> <filter-mapping> <filter-name> opensessioninviewfilter </filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
2, if the problem has not been resolved. It's a package conflict. Hibernate and Strus both have javassist-xx.jar this package only needs to be imported one on it, remove one of them.
JAVA.LANG.CLASSCASTEXCEPTION:COM.BJSXT.REGISTRATION.MODEL.USER_$$_JAVASSIST_0 cannot is cast to Javassist.util.proxy.Proxy