[midPoint] Handling AlreadyExistsException on Rest Connector

Nicolas Rossi nrossi at identicum.com
Fri Jul 6 22:48:17 CEST 2018


Hi guys, I developed a Rest Connector and it's working fine for almost all
operations. I can create, update, query and delete accounts on the resource
but there is an issue when I try to create account if it already exists on
the resource. The connector raises an AlreadyExistsException on the create
method as described here
<https://wiki.evolveum.com/display/midPoint/Connector+Development+Guide>.
The midpoint log shows that the framework detects the exception and
searches the object with the matching attributes and finally it is found.
For some reason after searching the object on the resource and converting
it to a midpoint object, the shadow is not being created and the operations
ends with a message "Probably invalid projection context: both old and new
objects are null". The object is retrieved with all attributes (__UID__,
__NAME__ and so on):

2018-07-06 17:31:00,845 [] [pool-4-thread-10] TRACE
(com.evolveum.midpoint.provisioning.impl.ResourceObjectConverter):
Searching resource objects done: SUCCESS

2018-07-06 17:31:00,846 [] [pool-4-thread-10] DEBUG
(com.evolveum.midpoint.provisioning.consistency.impl.ObjectAlreadyExistHandler):
Processing "already exists" error for shadow:

  shadow: (null, ShadowType)

      intent: default

      kind: ACCOUNT

      objectClass: {...resource/instance-3}AccountObjectClass

      resourceRef: oid=702ecc89-deba-4542-9618-5b9c8ba94abe(ResourceType)*

      attributes:

          email: aortis at identicum.com

          name: aortis

          lastName: Ortis

          firstName: Agustin

      iteration: 0

      iterationToken:

      metadata:

          requestTimestamp: 2018-07-06T17:30:59.854-03:00

          requestorRef:
oid=00000000-0000-0000-0000-000000000002(UserType)('administrator')[default]

          createChannel:
http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user

          createTimestamp: 2018-07-06T17:31:00.753-03:00

          creatorRef:
oid=00000000-0000-0000-0000-000000000002(UserType)('administrator')[default]

      result:
RT(com.evolveum.midpoint.provisioning.api.ProvisioningService.addObject,FATAL_ERROR,Could
not create object on the resource. Object already exists on the resource:
org.identityconnectors.framework.common.exceptions.AlreadyExistsException(HTTP
error 409  : ))

Conflicting shadow:

  null

2018-07-06 17:31:00,846 [] [pool-4-thread-10] ERROR
(com.evolveum.midpoint.provisioning.impl.ProvisioningServiceImpl): Couldn't
add object. Object already exist: Object already exists on the resource:
org.identityconnectors.framework.common.exceptions.AlreadyExistsException(HTTP
error 409  : )

The HTTP Error 409 (CONFLICT) is returned by the connected resource when it
tries to create a user that already exists.

Here is the full operation log with provisioning logger on TRACE level:
https://pastebin.com/G9ZpZYPe

By the way, if I import resource accounts (from the Resource / Accounts
table) they are imported without any errors.

Any Ideas ?

Thanks in advance,



Ing Nicolás Rossi
Identicum S.A.
Jorge Newbery 3226
Tel: +54 (11) 4552-3050
www.identicum.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20180706/24a86d25/attachment.htm>


More information about the midPoint mailing list