0 Replies Latest reply on Dec 15, 2009 3:05 AM by Harpreet Dhanoa

    JpaPermissionStore problem

    Harpreet Dhanoa Newbie

      Hi,
      I am tring to implement JpaPermissionStore in seam 2.2.0 GA and getting a Null pointer Exception at line 199 in JpaPermissionStore as roleTargetProperty is null (roleTargetProperty.getName() ) .


      somehow no messages from initProperties() as it rey ti initialize all the properties



      here is my Role Class


      @Entity
      public class RolePermission implements Serializable {
      
          private static final long serialVersionUID = 1L;
      
          @Id
          @SequenceGenerator(name = "RolePermission", sequenceName = "role_permission_id")
          @GeneratedValue(generator = "RolePermission")
          private Integer id;
      
          private String recipient;
          private String target;
          private String action;
      
          public Integer getId() {
              return id;
          }
      
          public void setId(Integer id) {
              this.id = id;
          }
      
          @PermissionRole
          public String getRecipient() {
              return recipient;
          }
      
          public void setRecipient(String recipient) {
              this.recipient = recipient;
          }
      
          @PermissionTarget
          public String getTarget() {
              return target;
          }
      
          public void setTarget(String target) {
              this.target = target;
          }
      
          @PermissionAction
          public String getAction() {
              return action;
          }
      
          public void setAction(String action) {
              this.action = action;
          }
      



      and I am adding the role class to component.xml as


        <security:jpa-permission-store   role-permission-class="com.mycompany.package.RolePermission"     /> 



      and calling the permissions from action like



       
       permissionManager.grantPermission(new Permission(
                                  entityManager.find(MyEntity.class, 60),
                                  "update", new org.jboss.seam.security.Role(
                                          "EntityEditRole")));