org.hibernate.LazyInitializationException
程序员文章站
2022-03-02 14:10:12
...
spring3+hibernate4配置环境的时候,用Junit4测试一个方法:出现懒加载异常 ,web.xml里配置了openSessioninViewFilter,使用
public class TestSessionFactory extends AbstractJUnit4SpringContextTests
就这个报错,而继承
public class TestSessionFactory
extends AbstractTransactionalJUnit4SpringContextTests
就不会出现,懒加载异常。(技术太菜不知道为啥啊)
转载于:https://my.oschina.net/asilan/blog/145086
推荐阅读
-
解决:org.hibernate.LazyInitializationException: could not initialize proxy - no Session
-
org.hibernate.LazyInitializationException: could not initialize proxy [xxxx] - no Session异常
-
Hiberante异常之org.hibernate.LazyInitializationException: could not initialize proxy - no Session
-
【记录】异常:org.hibernate.LazyInitializationException: could not initialize proxy - no Session
-
org.hibernate.LazyInitializationException: could not initialize proxy 解决方案(JPA)
-
Jpa项目报错:org.hibernate.lazyinitializationexception could not initialize proxy - no session
-
org.hibernate.LazyInitializationException: could not initialize proxy no Session
-
jpa 解决org.hibernate.LazyInitializationException: could not initialize proxy - no Session
-
Spring DATA JPA org.hibernate.LazyInitializationException: could not initialize proxy - no Session
-
org.hibernate.LazyInitializationException: could not initialize proxy - no Session