首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

在web.xml 文件上添加 OpenEntityManagerInViewFilter

2012-10-12 
在web.xml 文件下添加 OpenEntityManagerInViewFilter错误原因 13:34:34,859 ERROR LazyInitializationExc

在web.xml 文件下添加 OpenEntityManagerInViewFilter

错误原因 13:34:34,859 ERROR LazyInitializationException:42 - could not initialize proxy - no Session org.hibernate.LazyInitializationException: could not initialize proxy - no Session

解决方法 这里注意顺序。。必需放在之前(因为低层Filter 的原理是从上到下过滤的) <!-- OpenEntityManagerInViewFilter required prior to struts2-->

<!-- OpenEntityManagerInViewFilter required prior to struts2-->    <filter>        <filter-name>SpringOpenEntityManagerInViewFilter</filter-name>        <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>    </filter>    <filter-mapping>        <filter-name>SpringOpenEntityManagerInViewFilter</filter-name>        <url-pattern>/*</url-pattern>    </filter-mapping>    <!-- Struts2 Filter --><filter>        <filter-name>struts2</filter-name>        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>    </filter>    <filter-mapping>        <filter-name>struts2</filter-name>        <url-pattern>*.action</url-pattern>    </filter-mapping>    <filter-mapping>        <filter-name>struts2</filter-name>        <url-pattern>*.jsp</url-pattern>    </filter-mapping>

?

热点排行