com.accp.dao.impl.StudentsDAOImpl@1ba92db
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/09/03 10:28:00
com.accp.dao.impl.StudentsDAOImpl@1ba92db
Hibernate:select top 2 students0_.id as id0_,students0_.class_id as class2_0_,students0_.name as name0_,students0_.age as age0_ from students students0_ order by students0_.id desc
Hibernate:select count(*) as col_0_0_ from students students0_
2011-8-15 16:27:36 org.apache.catalina.core.ApplicationDispatcher invoke
严重:Servlet.service() for servlet jsp threw exception
org.hibernate.LazyInitializationException:could not initialize proxy - the owning Session was closed
\x05at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:56)
\x05at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:98)
\x05at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:158)
\x05at com.accp.entity.Classes$$EnhancerByCGLIB$$d773eff9.getName()
\x05at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\x05at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
\x05at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
\x05at java.lang.reflect.Method.invoke(Method.java:597)
.
Hibernate:select top 2 students0_.id as id0_,students0_.class_id as class2_0_,students0_.name as name0_,students0_.age as age0_ from students students0_ order by students0_.id desc
Hibernate:select count(*) as col_0_0_ from students students0_
2011-8-15 16:27:36 org.apache.catalina.core.ApplicationDispatcher invoke
严重:Servlet.service() for servlet jsp threw exception
org.hibernate.LazyInitializationException:could not initialize proxy - the owning Session was closed
\x05at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:56)
\x05at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:98)
\x05at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:158)
\x05at com.accp.entity.Classes$$EnhancerByCGLIB$$d773eff9.getName()
\x05at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\x05at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
\x05at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
\x05at java.lang.reflect.Method.invoke(Method.java:597)
.
就是在Hibernate 映射表的xml 文件中.将many -to -one 里面加一个lazy="false"