session is closed!

来源:2-6 页面调用

慕斯卡1381253

2017-03-11 16:22


org.hibernate.SessionException: Session is closed!
    at org.hibernate.internal.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:129)
    at org.hibernate.internal.SessionImpl.getPersistenceContext(SessionImpl.java:1937)
    at org.hibernate.internal.AbstractQueryImpl.isReadOnly(AbstractQueryImpl.java:214)
    at org.hibernate.internal.AbstractQueryImpl.getQueryParameters(AbstractQueryImpl.java:933)
    at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
    at service.impl.UsersDAOImpl.usersLogin(UsersDAOImpl.java:27)
    at action.UsersAction.login(UsersAction.java:27)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:871)
    at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1294)
    at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
    at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:117)
    at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:108)
    at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1370)

写回答 关注

2回答

  • 亨利_慕粉4190963
    2017-03-23 23:18:22

      at service.impl.UsersDAOImpl.usersLogin(UsersDAOImpl.java:27)
        at action.UsersAction.login(UsersAction.java:27)


    这里,检查一下你的代码是不是关闭了session

  • 亨利_慕粉4190963
    2017-03-23 23:17:17

    就是session关闭了呗

使用Struts2+Hibernate开发学生信息管理功能

Strust2+Hibernate整合开发案例,Java Web开发技能更上一层楼

80701 学习 · 754 问题

查看课程

相似问题