1 Reply Latest reply on Sep 18, 2013 11:36 AM by Nicola Ben

    PLIDM000602: Could not add AttributedType [org.picketlink.idm.model.basic.User@8a1569e0].

    Nicola Ben Novice

      Hi,

      using picketlink 2.5.2.Final

      I get the error PLIDM000602: Could not add AttributedType [org.picketlink.idm.model.basic.User@8a1569e0].

      when trying to add a new user as shown in the code:

       

       

       private void performRegistration(UserRequest request) {
              String email = request.getUser().getEmail();
      
              User newUser = new User(email);
              newUser.setFirstName(request.getUser().getName());
              newUser.setLastName(request.getUser().getSurname());
              newUser.setEmail(email);
      
              Partition partition = partitionManager.getPartition(Realm.class, "default");
              newUser.setPartition(partition);
      
              identityManager.add(newUser);
      

       

      I cannot figure out what AttributedType causes the problem.

      Any suggestion please?

       

      Bye

      Nic

        • 1. Re: PLIDM000602: Could not add AttributedType [org.picketlink.idm.model.basic.User@8a1569e0].
          Nicola Ben Novice

          Hi,

          I drilled more on that problem.

           

          Debugging I found that the origin of my exception is in ContextualIdentityManager.java

           

           @Override
              public void add(IdentityType identityType) throws IdentityManagementException {
                  checkUniqueness(identityType);
                  try {
                      storeSelector.getStoreForIdentityOperation(this, IdentityStore.class, identityType.getClass(), IdentityOperation.create)
                              .add(this, identityType);
                      addAttributes(identityType);
                  } catch (Exception e) {
                      throw MESSAGES.attributedTypeAddFailed(identityType, e);
                  }
              }
          

           

          at line 5.

          An exception is thrown:

          JBAS011469: Transaction is required to perform this operation (either use a transaction or extended persistence context)

          but the message is then mapped as the one in the subject.

           

          Bye

          Nic