问答详情
源自:2-6 页面调用

session is closed!


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)

提问者:慕斯卡1381253 2017-03-11 16:22

个回答

  • 亨利_慕粉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关闭了呗