shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rudi Wijaya (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SHIRO-557) SessionContext must be an HTTP compatible implementation
Date Fri, 29 Jan 2016 10:04:39 GMT

    [ https://issues.apache.org/jira/browse/SHIRO-557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15123295#comment-15123295
] 

Rudi Wijaya commented on SHIRO-557:
-----------------------------------

I got the solution (or workaround?):
{code}
final Subject currentUser = new WebSubject.Builder(servletRequest, servletResponse).buildSubject();
currentUser.login(token);
{code}

> SessionContext must be an HTTP compatible implementation
> --------------------------------------------------------
>
>                 Key: SHIRO-557
>                 URL: https://issues.apache.org/jira/browse/SHIRO-557
>             Project: Shiro
>          Issue Type: Bug
>          Components: Authentication (log-in)
>    Affects Versions: 1.2.4
>            Reporter: Rudi Wijaya
>             Fix For: 1.2.4
>
>
> It is related with SHIRO-350
> {code}
> final UsernamePasswordToken token = new UsernamePasswordToken(upUsername, upPassword.toCharArray(),
"payment");
> final Subject currentUser = SecurityUtils.getSubject();
> currentUser.login(token);
> {code}
> {code}
> Unexpected RuntimeException
> Last cause: SessionContext must be an HTTP compatible implementation.
> WicketMessage: Method onRequest of interface org.apache.wicket.behavior.IBehaviorListener
targeted at com.rudiwijaya.payment.pages.LoginButton$1@1cd4d15c on component [LoginButton
[Component id = login]] threw an exception
> Stacktrace
> Root cause:
> java.lang.IllegalArgumentException: SessionContext must be an HTTP compatible implementation.
>      at org.apache.shiro.web.session.mgt.ServletContainerSessionManager.createSession(ServletContainerSessionManager.java:103)
>      at org.apache.shiro.web.session.mgt.ServletContainerSessionManager.start(ServletContainerSessionManager.java:64)
>      at org.apache.shiro.mgt.SessionsSecurityManager.start(SessionsSecurityManager.java:121)
>      at org.apache.shiro.subject.support.DelegatingSubject.getSession(DelegatingSubject.java:336)
>      at org.apache.shiro.subject.support.DelegatingSubject.getSession(DelegatingSubject.java:312)
>      at org.apache.shiro.mgt.DefaultSubjectDAO.mergePrincipals(DefaultSubjectDAO.java:204)
>      at org.apache.shiro.mgt.DefaultSubjectDAO.saveToSession(DefaultSubjectDAO.java:166)
>      at org.apache.shiro.mgt.DefaultSubjectDAO.save(DefaultSubjectDAO.java:147)
>      at org.apache.shiro.mgt.DefaultSecurityManager.save(DefaultSecurityManager.java:383)
>      at org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:350)
>      at org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:183)
>      at org.apache.shiro.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:283)
>      at org.apache.shiro.subject.support.DelegatingSubject.login(DelegatingSubject.java:256)
>      at com.rudiwijaya.payment.pages.LoginButton.doAuthenticate(LoginButton.java:138)
>      at com.rudiwijaya.payment.pages.LoginButton.onSubmit(LoginButton.java:157)
>      at com.rudiwijaya.payment.pages.LoginButton$1.onSubmit(LoginButton.java:91)
>      at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$AjaxFormSubmitter.onSubmit(AjaxFormSubmitBehavior.java:215)
>      at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1305)
>      at org.apache.wicket.markup.html.form.Form.process(Form.java:966)
>      at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:788)
>      at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:171)
>      at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:145)
>      at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:649)
>      at java.lang.reflect.Method.invoke(Method.java:498)
>      at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
>      at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
>      at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:250)
>      at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:236)
>      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:890)
>      at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
>      at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
>      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
>      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
>      at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
>      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
>      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
>      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>      at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:123)
>      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
>      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>      at org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:171)
>      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
>      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
>      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
>      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
>      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>      at java.lang.Thread.run(Thread.java:745)
> Complete stack:
> org.apache.wicket.WicketRuntimeException: Method onRequest of interface org.apache.wicket.behavior.IBehaviorListener
targeted at com.rudiwijaya.payment.pages.LoginButton$1@1cd4d15c on component [LoginButton
[Component id = login]] threw an exception
>      at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268)
>      at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
>      at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:250)
>      at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:236)
>      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:890)
>      at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
>      at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
>      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
>      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
>      at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
> java.lang.reflect.InvocationTargetException
>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>      at java.lang.reflect.Method.invoke(Method.java:498)
>      at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
>      at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
>      at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:250)
>      at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:236)
>      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:890)
>      at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
>      at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
>      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
>      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
>      at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
> display page view
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message