Sorry, problem including the rest of the log:
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Unique index
or primary key violation: "U_MMBRSHP_SYNCOPEUSER_ID_INDEX_C ON
PUBLIC.MEMBERSHIP(SYNCOPEUSER_ID, SYNCOPEROLE_ID) VALUES (101, 100, 151)";
SQL statement: INSERT INTO PUBLIC.Membership (ID, CREATIONDATE, CREATOR,
LASTCHANGEDATE, LASTMODIFIER, SYNCOPEUSER_ID, SYNCOPEROLE_ID) VALUES (?, ?,
?, ?, ?, ?, ?) [23505-185] {prepstmnt 1618806582 INSERT INTO
PUBLIC.Membership (ID, CREATIONDATE, CREATOR, LASTCHANGEDATE, LASTMODIFIER,
SYNCOPEUSER_ID, SYNCOPEROLE_ID) VALUES (?, ?, ?, ?, ?, ?, ?)} [code=23505,
state=23505]
I also can't add or remove roles through the UI now. I can't delete the
user either.
On Thu, Mar 19, 2015 at 4:56 PM, John Ellinwood <[email protected]>
wrote:
> I am trying to use the rest api for syncope. I'm trying this on syncope
> 1.2.2. My rest client is Jersey, but this happens just using RestClient
> from Firefox as well.
>
>
> I have a user, "user1" id 101.
> I have a roles. "role1" id 100
>
> Request:
> POST http://localhost:9080/syncope/rest/users/101
> {"id":101,"membershipsToAdd":[{"role":100}]}
> Response
> 200 Succes
>
> Request:
> POST http://localhost:9080/syncope/rest/users/101
> {"id":101,"membershipsToRemove":[100]}
> Response
> 200 Success
>
> Request:
> POST http://localhost:9080/syncope/rest/users/101
> {"id":101,"membershipsToAdd":[{"role":100}]}
> Response
> 409 Conflict, DataIntegrityViolation. The transaction has been rolled
> back. See the nested exception for details on the errors that occurred.
>
> Log:
> ...Caused by: org.apache.openjpa.lib.jdbc.ReportinSQLException: Unique
> index or pimary key violation: "U_MMBRSHP_SYNCOPEUSER_ID_INDEX_C ON PUBLIC.
>
>
>