0 Replies Latest reply on Sep 14, 2008 12:06 AM by Luis Tama

    Extended Identity not being loaded during Initialization

    Luis Tama Newbie

      Hi all...


      I have a problem with extended components (at least an extended Identity, as explained in the docs) not being loaded during Seam Initialization process, but the default ones winning in precedence. I fired a JBSEAM-3404 JIRA issue about it, but still have no answer.


      The problem occurs when using Seam 2.1.0-SNAPSHOT. I'm using snapshot 303 because I also had the redeploying NullPointerException problem, which was related to JBSEAM-3357 JIRA issue, which was solved in snapshot 296, revision 8857, with some changes in Initialization.java.


      But now, I can't download snapshot 296, there is no download link to it, and Initialization.java has had more changes in newer snapshots in trunk.


      I don't like the NPE problem, which is supposedly solved with the fixes in trunk (I have to manually redeploy all my webapp to see a little change working... :-S ). But with the fixes in the snapshot, I can't even use my extended Identity component, so can't test the solved issues.


      Has anyone else had this issue? Can anyone else test? I attach the issue description below. Hope someone can help...


      Regards,


      Luis Tama



      JBSEAM-3404 Description:


      I have this Extended Identity component, which lets me render different home pages according to the user roles:
      
      @Name("org.jboss.seam.security.identity")
      @Scope(ScopeType.SESSION)
      @Install(precedence = Install.APPLICATION)
      @BypassInterceptors
      @Startup
      public class Identity extends org.jboss.seam.security.Identity {
      
      private static final String DEFAULT_HOME_PAGE = "/home/home.xhtml";
      private String homePage = DEFAULT_HOME_PAGE;
      
      // getter and setter for homePage, and business logic
      
      // and some other important properties related to my business model...
      }
      
      In Seam 2.1.0.BETA1, it works fine:
      ...
      21:53:16,159 INFO [Initialization] Installing components...
      ...
      21:53:16,921 INFO [Component] Component: org.jboss.seam.security.identity, scope: SESSION, type: JAVA_BEAN, class: org.ostion.siplacad.session.Identity
      ...
      
      In Seam 2.1.0-SNAPSHOT # 303, it's not being loaded:
      ...
      21:55:54,125 INFO [Initialization] Installing components...
      ...
      21:55:55,500 INFO [Component] Component: org.jboss.seam.security.identity, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.security.Identity
      ...
      21:55:56,765 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.security.identity
      ...
      
      So I can't access identity.homePage from my webapp. I can see this exception in debug.seam:
      Exception during request processing:
      Caused by javax.el.MethodNotFoundException with message: "Method not found: org.jboss.seam.security.Identity@9527ee.renderHomePage()"
      ...
      I will not post the full stack trace, because the obvious reason for the problem is that the extended component is not being loaded by Seam.
      
      I checked Seam source code, comparing versions BETA1 and SNAPSHOT # 303:
      Class org.jboss.seam.Component has no changes between versions.
      Class org.jboss.seam.security.Identity has changed, but i don't think there is a problem there.
      Class org.jboss.seam.init.Initialization does have some changes, specially regarding hotDeploymentStrategy. I guess there is a problem is with the hacks over there.
      
      Please check this. I must tell I switched to the SNAPSHOT to not have the "NPE with hot Redeployment" issue, but now I can't even see my webapp!!