1 Reply Latest reply on Mar 22, 2007 9:37 AM by Gavin King

    Again - @Restrict - No redirection to Error Page

    Fabrizio Boco Newbie

      Hi all,

      since I was not able to solve my problems with @Redirect(#{s:hasRole('admin')) (see http://www.jboss.com/index.html?module=bb&op=viewtopic&t=104328) I looked into examples again.

      I have deployed the dvd-store application (that uses @Redirect(#{s:hasRole('admin')) ), I logged in as user1 then I tried to access to administration page (http://localhost:8080/seam-dvd/debug.seam) and I got the debug page with the following error:

      Exception during request processing: org.jboss.seam.security.AuthorizationException: Authorization check failed for expression [#{s:hasRole('admin')}]
      
      org.jboss.seam.security.Identity.checkRestriction(Identity.java:160)
      org.jboss.seam.pages.Page.enter(Page.java:206)
      org.jboss.seam.core.Pages.enterPage(Pages.java:276)
      org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:265)
      org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:203)
      org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:57)
      org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
      org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
      org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
      org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
      org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
      org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
      org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
      org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
      org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
      org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      java.lang.Thread.run(Thread.java:595)
      


      Questions are:

      1) Is my environment misconfigured ? (I am using jboss-4.0.5 installed from the last installer with ejb3 or ejb3-clustered profile, JDK 1.5.0_08, jboss-seam-CVS.20070320)

      2) Is anybody able to get @Redirect(#{s:hasRole('admin')) working ?

      3) Do I have to open a bug in jira ?

      Thank you in advance

      Regards

      Fab.