.WebDelegatingSubject cannot be cast to cn.itcast.bos.domain.system.User

来源:互联网 发布:山东大学威海知乎 编辑:程序博客网 时间:2024/06/07 20:42
认证完成得到userUser [id=2001, birthday=null, gender=null, password=123, remark=null, station=null, telephone=null, username=zhangsan, nickname=null]*****************************************************
15:42:17,879 ERROR DefaultDispatcherErrorHandler:42 - Exception occurred during processing request: org.apache.shiro.web.subject.support.WebDelegatingSubject cannot be cast to cn.itcast.bos.domain.system.User
java.lang.ClassCastException: org.apache.shiro.web.subject.support.WebDelegatingSubject cannot be cast to cn.itcast.bos.domain.system.User
    at cn.itcast.bos.web.action.system.MenuAction.showMenu(MenuAction.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:870)
    at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1293)
    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:1369)


错误代码:    User user = (User) SecurityUtils.getSubject();


报错为 .WebDelegatingSubject cannot be cast to cn.itcast.bos.domain.system.User

阅读全文
0 0
原创粉丝点击