2 Replies Latest reply on Nov 16, 2009 8:23 PM by atamhank

    Possible bug in JpaPermissionStore.jave

      Finding more bugs thanks to Findbugs, in JpaPermissionStore in the method  protected void initProperties(), at the end:


       if (rolePermissionClass != null)
       {
       //Other stuff
       }
       else if (!discriminatorProperty.isSet())
            {
               throw new RuntimeException("Invalid userPermissionClass " + rolePermissionClass.getName() +
                     " - no rolePermissionClass set and @PermissionDiscriminator annotation not found on " +
                     "any Field or Method");
            }
      



      The rolePermissionClass will be null always... the line with the throw new RuntimeException("Invalid userPermissionClass " + rolePermissionClass.getName() will crash with a null pointer exception...  am I wrong?


      Should I submit a JIRA?... I am not exactly sure about how to patch this... any hints?

        • 1. Re: Possible bug in JpaPermissionStore.jave
          dan.j.allen

          Fixed, good catch.

          • 2. Re: Possible bug in JpaPermissionStore.jave
            atamhank
            Where is the solutions? I am getting similar error if any table or filed is added after identity-manager is added via Seam-gen. during runtime.
            Seam-2.2.0.GA + JBoss 5.1.0.GA + Postgresql 8.3


            Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.jpaPermissionStore
            ..
            Caused by: java.lang.RuntimeException: Invalid userPermissionClass com.test3.model.UserPermission - required annotation @PermissionUser not found on any Field or Method.
                 at org.jboss.seam.security.permission.JpaPermissionStore.initProperties(JpaPermissionStore.java:129)