2 Replies Latest reply on Oct 30, 2008 11:44 PM by Dmitry Shultz

    2.1.0 GA Redirect is not the same as in CR1

    Dmitry Shultz Newbie

      Hi,


      I have a login s:button with such an action:



      public String login() {
              Events.instance().raiseEvent("logInStarted");
              return "/secure/login.xhtml";
      }



      the components.xml has following lines:


      <event type="logInStarted">
              <action execute="#{redirect.captureCurrentView}"/>
      </event>
      
      <event type="org.jboss.seam.security.postAuthenticate">
              <action execute="#{redirect.returnToCapturedView}"/>
      </event>



      It works using 2.1.0 CR1, but doesn't (the client is not redirected to view captured before login, just the same login.xhtml is rerendered) with Seam 2.1.0 GA.


      I'm not changing anything except of the Seam jars, Glassfish 9.1


      Should I open a bug or there is some change in logic?

        • 1. Re: 2.1.0 GA Redirect is not the same as in CR1
          Dmitry Shultz Newbie

          I still don't get it.


          It is just not redirecting when compiled and built on OS X ( using Java 5), but fails with exception when compiled and run using Java 6 (the same code).


          Here is the stack trace:


          Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component: org.jboss.seam.security.ruleBasedPermissionResolver" 
          org.jboss.seam.Component.newInstance(Component.java:2066)
          org.jboss.seam.Component.getInstance(Component.java:1948)
          org.jboss.seam.Component.getInstance(Component.java:1910)
          org.jboss.seam.core.Events.raiseEvent(Events.java:77)
          org.jboss.seam.security.Identity.postAuthenticate(Identity.java:388)
          org.jboss.seam.security.Identity.authenticate(Identity.java:336)
          org.jboss.seam.security.Identity.authenticate(Identity.java:324)
          org.jboss.seam.security.Identity.login(Identity.java:253)
          
          
          Caused by org.jboss.seam.InstantiationException with message: "Could not instantiate Seam component: securityRules" 
          org.jboss.seam.Component.newInstance(Component.java:2066)
          org.jboss.seam.Component.getInstance(Component.java:1948)
          org.jboss.seam.Component.getInstance(Component.java:1910)
          org.jboss.seam.Component.getInstance(Component.java:1904)
          org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
          org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
          org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
          org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
          javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
          com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
          org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
          org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
          org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
          org.jboss.seam.Component$ELInitialValue.getValue(Component.java:2461)
          org.jboss.seam.Component.initialize(Component.java:1454)
          org.jboss.seam.Component.postConstructJavaBean(Component.java:1380)
          org.jboss.seam.Component.postConstruct(Component.java:1303)
          org.jboss.seam.Component.newInstance(Component.java:2051)
          org.jboss.seam.Component.getInstance(Component.java:1948)
          org.jboss.seam.Component.getInstance(Component.java:1910)
          org.jboss.seam.core.Events.raiseEvent(Events.java:77)
          org.jboss.seam.security.Identity.postAuthenticate(Identity.java:388)
          org.jboss.seam.security.Identity.authenticate(Identity.java:336)
          org.jboss.seam.security.Identity.authenticate(Identity.java:324)
          org.jboss.seam.security.Identity.login(Identity.java:253)
          
          
          Caused by java.lang.RuntimeException with message: "exception invoking: compileRuleBase" 
          org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:148)
          org.jboss.seam.Component.callComponentMethod(Component.java:2171)
          org.jboss.seam.Component.callCreateMethod(Component.java:2094)
          org.jboss.seam.Component.newInstance(Component.java:2054)
          org.jboss.seam.Component.getInstance(Component.java:1948)
          org.jboss.seam.Component.getInstance(Component.java:1910)
          org.jboss.seam.Component.getInstance(Component.java:1904)
          org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
          org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
          org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
          org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
          javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
          com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
          org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
          org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
          org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
          org.jboss.seam.Component$ELInitialValue.getValue(Component.java:2461)
          org.jboss.seam.Component.initialize(Component.java:1454)
          org.jboss.seam.Component.postConstructJavaBean(Component.java:1380)
          org.jboss.seam.Component.postConstruct(Component.java:1303)
          org.jboss.seam.Component.newInstance(Component.java:2051)
          org.jboss.seam.Component.getInstance(Component.java:1948)
          org.jboss.seam.Component.getInstance(Component.java:1910)
          org.jboss.seam.core.Events.raiseEvent(Events.java:77)
          org.jboss.seam.security.Identity.postAuthenticate(Identity.java:388)
          org.jboss.seam.security.Identity.authenticate(Identity.java:336)
          org.jboss.seam.security.Identity.authenticate(Identity.java:324)
          org.jboss.seam.security.Identity.login(Identity.java:253)




          Can anybody explain what's going on here?

          • 2. Re: 2.1.0 GA Redirect is not the same as in CR1
            Dmitry Shultz Newbie

            Ok, I've missed one of the drools jars in my java 6 environment.
            After it was added nothing fails with exception, but redirect still not happening.


            Another case, when user is redirected to loging page as a result of org.jboss.seam.security.NotLoggedInException exception (and redirected back after login to the page that is restricted) works fine.


            So only this case, when user presses login button on the homepage and provided by the login page is not working for me, i.e. user is not automatically redirected to home (or whatever page) after successfull login.