повторная авторизация

16 views
Skip to first unread message

maratische

unread,
Dec 23, 2008, 5:09:25 AM12/23/08
to The Russia JBoss Seam user group
получаю интересную ошибку
пользователь авторизуется в систему, все прекрасно, после делает
logout
и заново авторизуется, получает ошибку
Your session has timed out, please try again
Следующая авторизация происходит нормально.
Насколько я понимаю при заходе на страничку login.xhtml должны
убиваться все сессии, а этого не происходит, почему я не понимаю.
pages.xml
<page view-id="*">
<navigation>
<rule if-outcome="home">
<redirect view-id="/home.xhtml"/>
</rule>
</navigation>
<navigation from-action="#{identity.logout}">
<redirect view-id="/login.xhtml"/>
</navigation>
<navigation from-action="#{identity.login}">
<redirect view-id="/home.xhtml"/>
</navigation>
</page>

components.xml
<security:identity authenticate-method="#
{authenticator.authenticate}"
remember-me="true" />

собственно логин
<h:form id="login">
<table class="layout">
<tr>
<td class="labelColumn">
<a4j:outputPanel id="loginUserName">
#{messages['advoicelite.login.username']}:
</a4j:outputPanel>
</td>
<td>
<h:inputText id="username" value="#
{identity.username}" />
</td>
</tr>
<tr>
<td class="labelColumn">
<a4j:outputPanel
id="loginPassword">
#{messages['advoicelite.login.password']}:
</a4j:outputPanel>
</td>
<td>
<h:inputSecret id="password" value="#
{identity.password}" />
</td>
</tr>
<tr>
<td>
<a4j:outputPanel id="loginLanguage">
#{messages['advoicelite.login.language']}:
</a4j:outputPanel>
</td>
<td>
</td>
</tr>
<tr>
<td></td>
<td align="center">
<br/>
<a4j:outputPanel id="loginButton">
<h:commandButton value="#{messages
['advoicelite.login.login']}" action="#{identity.login}"
styleClass="cibutton"/>
</a4j:outputPanel>
</td>
</tr>
</table>
</h:form>

И собственно сама ошибка
13:02:27,995 WARN [lifecycle] executePhase(RESTORE_VIEW
1,com.sun.faces.context.FacesContextImpl@1ab04ce) threw excepti
on
javax.faces.application.ViewExpiredException: viewId:/login.seam -
null MessageFactory
at com.sun.faces.lifecycle.RestoreViewPhase.execute
(RestoreViewPhase.java:185)
at com.sun.faces.lifecycle.LifecycleImpl.phase
(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute
(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:
265)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:
508)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter
(SeamFilter.java:83)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter
(HotDeployFilter.java:51)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter
(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter
(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter
(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter
(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter
(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter
(BaseXMLFilter.java:154)
at org.ajax4jsf.webapp.BaseFilter.handleRequest
(BaseFilter.java:260)
at
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest
(BaseFilter.java:366)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:
493)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter
(Ajax4jsfFilter.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter
(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter
(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter
(SeamFilter.java:69)
at org.jboss.seam.web.IdentityFilter.doFilter
(IdentityFilter.java:38)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter
(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:
158)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:175)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke
(SecurityAssociationValve.java:179)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke
(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke
(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run
(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
13:02:27,995 WARN [ExceptionFilter] handling uncaught exception
javax.servlet.ServletException: viewId:/login.seam - null
MessageFactory

Marat Gizatullin

unread,
Dec 23, 2008, 6:46:20 AM12/23/08
to The Russia JBoss Seam user group
В данный момент проблема решена достаточно банальным, но ИМХА не красивым способом, ниже.
Имха вся беда с сессиями при login/logout аккумулируется из-за того, что у нас Authenticator.java маппит в себя кучу Spring бинов
Ну или мои кривые руки, так как сходу сбацанный прототипчик с такими же contents.xml и pages.xml и авторизацией (без спринговых бинов) работает

итак решение:
добавил view="/index.xhtml"
                            <s:button view="/index.xhtml" action="#{identity.logout()}" styleClass="cibutton" value="Log out"/>
 index.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <head>
        <meta http-equiv="Refresh" content="0; URL=login.seam" />
    </head>
<body>
</body>
</html>

Reply all
Reply to author
Forward
0 new messages