[midPoint] No definition for item in a Manual Resource
Nicolas Rossi
nrossi at identicum.com
Wed May 29 17:59:59 CEST 2019
Hi guys, we are facing an issue with a Manual Resource when updating a
resource attribute if it wasn't present when the shadow was created. Let me
share some context:
- The manual resource defines an attribute on the schema:
*<xsd:element minOccurs="0" name="organizationalUnit" type="xsd:string"/>*
- There is a mapping on the resource for this attribute:
*<attribute id="9">*
* <c:ref>ri:organizationalUnit</c:ref>*
* <outbound>*
* <source>*
* <c:path>$user/organizationalUnit</c:path>*
* </source>*
* </outbound>*
*</attribute>*
- If the user receiving the resource has no value on the attribute then
the shadow is created without this attribute (element
<ri:organizationalUnit> is missing):
*<attributes>*
* <ri:username>a.santos</ri:username>*
* <ri:emailAddress>a.santos at xxxx.com</ri:emailAddress>*
* .....*
*</attributes>*
- Then the user set a new value for the organizationalUnit attribute, it
enters as a Delta:
* <pendingOperation id="33">*
* <delta>*
* <t:changeType>modify</t:changeType>*
* <t:objectType>c:ShadowType</t:objectType>*
* <t:oid>8ff9d322-658b-40ce-9ad5-533eeca0d96a</t:oid>*
* <t:itemDelta>*
* <t:modificationType>replace</t:modificationType>*
* <t:path>c:attributes/ri:organizationalUnit</t:path>*
* <t:value xmlns:xsd="http://www.w3.org/2001/XMLSchema
<http://www.w3.org/2001/XMLSchema>"*
* xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance>"*
* xsi:type="xsd:string">Development</t:value>*
* </t:itemDelta>*
- And the operation fails with the error "ShadowRefresh of object
shadow:8ff9d322-658b-40ce-9ad5-533eeca0d96a(felipe.xxxx) shadow refresh
task failed: No definition for item {
http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}organizationalUnit
in PC({
http://midpoint.evolveum.com/xml/ns/public/common/common-3}attributes)".
at
com.evolveum.midpoint.prism.PrismContainerValue.createDetachedNewItemInternal(PrismContainerValue.java:779)
at
com.evolveum.midpoint.prism.PrismContainerValue.createSubItem(PrismContainerValue.java:767)
at
com.evolveum.midpoint.prism.PrismContainerValue.findCreateItem(PrismContainerValue.java:727)
at
com.evolveum.midpoint.prism.PrismContainer.findCreateItem(PrismContainer.java:495)
at
com.evolveum.midpoint.prism.PrismContainerValue.findCreateItem(PrismContainerValue.java:706)
at
com.evolveum.midpoint.prism.PrismContainer.findCreateItem(PrismContainer.java:495)
at
com.evolveum.midpoint.prism.PrismContainer.findOrCreateItem(PrismContainer.java:579)
at com.evolveum.midpoint.prism.delta.ItemDelta.applyTo(ItemDelta.java:1327)
at com.evolveum.midpoint.prism.delta.ItemDelta.applyTo(ItemDelta.java:1289)
at
com.evolveum.midpoint.repo.sql.helpers.ObjectUpdater.modifyObjectAttempt(ObjectUpdater.java:405)
at
com.evolveum.midpoint.repo.sql.SqlRepositoryServiceImpl.modifyObject(SqlRepositoryServiceImpl.java:571)
at
com.evolveum.midpoint.repo.cache.RepositoryCache.modifyObject(RepositoryCache.java:291)
at
com.evolveum.midpoint.repo.cache.RepositoryCache.modifyObject(RepositoryCache.java:267)
at
com.evolveum.midpoint.repo.cache.RepositoryCache.modifyObject(RepositoryCache.java:260)
at
com.evolveum.midpoint.provisioning.impl.ShadowManager.modifyShadowAttributes(ShadowManager.java:1438)
at
com.evolveum.midpoint.provisioning.impl.ShadowCache.refreshShadow(ShadowCache.java:1229)
at
com.evolveum.midpoint.provisioning.impl.ProvisioningServiceImpl.refreshShadow(ProvisioningServiceImpl.java:872)
at
com.evolveum.midpoint.model.impl.cleanup.ShadowRefreshTaskHandler$1.handleObject(ShadowRefreshTaskHandler.java:108)
at
com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler.processRequest(AbstractSearchIterativeResultHandler.java:325)
at
com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler.handle(AbstractSearchIterativeResultHandler.java:183)
at
com.evolveum.midpoint.repo.cache.RepositoryCache$1.handle(RepositoryCache.java:227)
at
com.evolveum.midpoint.repo.sql.helpers.ObjectRetriever.searchObjectsIterativeByPaging(ObjectRetriever.java:755)
at
com.evolveum.midpoint.repo.sql.SqlRepositoryServiceImpl.searchObjectsIterative(SqlRepositoryServiceImpl.java:838)
at
com.evolveum.midpoint.repo.cache.RepositoryCache.searchObjectsIterative(RepositoryCache.java:230)
at
com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeTaskHandler.run(AbstractSearchIterativeTaskHandler.java:292)
at
com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.executeHandler(JobExecutor.java:639)
at
com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.executeRecurrentTask(JobExecutor.java:522)
at
com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.execute(JobExecutor.java:180)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:588)
Looking here
<https://github.com/Evolveum/midpoint/blob/90e4b7adc44f6d97629b8e71d1af2c714ac7e593/infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/PrismContainerValueImpl.java#L792>
it seems that it cannot find the attribute definition on the resource.
Any thoughts ?
Ing Nicolás Rossi
Identicum S.A.
Jorge Newbery 3226
Oficina: +54 (11) 4552-3050
Móvil: +54 (911) 6041-3920
www.identicum.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20190529/5b0326e4/attachment.htm>
More information about the midPoint
mailing list