求助:OpenSessionInViewFilter

tyrival IT  2015-08-14 12:20:46
Spring 4.1.7 + Struts 2.3.24 + Hibernate 4.3.10

启用lazy加载时,在struts2前面加上了openSessionInViewFilter,然后就报错,和没启用openSessionInViewFilter一样
请问怎么解决

<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>

<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>/*</url-pattern>
</filter-mapping>


错误信息
Struts has detected an unhandled exception:
Messages:
net.vzhang.po.User_$$_javassist_0 cannot be cast to javassist.util.proxy.Proxy
File: org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java
Line number: 147
Stacktraces
java.lang.ClassCastException: net.vzhang.po.User_$$_javassist_0 cannot be cast to javassist.util.proxy.Proxy
...全文
53 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
tyrival 2015-08-20
自己解决了问题了
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2015-08-14 12:20
社区公告
暂无公告