<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello Xiaoshu,</p>
    <p>thank you for the information.</p>
    <p>At this moment, it looks like a bug in midPoint for me. The
      reason is that midPoint has all the information it needs to
      determine the shadow name (pid = 017). Most probably the
      definition of the shadow is incomplete at that particular moment:
      if the primary identifier (pid) would be correctly marked as such,
      midPoint would use it as the shadow name.</p>
    <p>The exception itself is really harmless here, and all it does is
      the pollution of the logfiles (which is, of course, ugly). At
      least I think so now.<br>
    </p>
    <p>Overall, this would deserve logging a JIRA issue, with the
      type=bug, and all the necessary details (see <a
        moz-do-not-send="true"
href="https://docs.evolveum.com/midpoint/reference/diag/creating-a-bug-report/"
        class="moz-txt-link-freetext">https://docs.evolveum.com/midpoint/reference/diag/creating-a-bug-report/</a>).</p>
    <p>We would be happy to fix that, but ... you know ... according to
      priorities (subscribers' bugs first).</p>
    <p>Nevertheless, I hope you will be able to continue with your work.</p>
    <p>Best regards,<br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Pavol Mederly
Software developer
evolveum.com

</pre>
    <div class="moz-cite-prefix">On 07/07/2022 15:26, Wang, Xiaoshu
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:BL0PR03MB42439FEC61EE60B44F88BAE79C839@BL0PR03MB4243.namprd03.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        font-size:10.0pt;
        font-family:"Courier New";}p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}div.WordSection1
        {page:WordSection1;}ol
        {margin-bottom:0in;}ul
        {margin-bottom:0in;}</style>
      <div class="WordSection1">
        <p class="MsoNormal"><span style="font-size:16.0pt">Yes, I have
            implemented an executeQuery so I can do kind of fetch by
            UID. The follows is the entire stack trace. By the way, I am
            using midpoint 4.5 on a local machine.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">15:12:31.577
            [pool-3-thread-15] ERROR
            com.evolveum.midpoint.model.impl.lens.LensUtil - Couldn't
            determine name for shadow -- continuing with no name;
            shadow:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">shadow:
            (3f01b3de-7a1c-4ab5-9735-e2cd8ed6e108, ShadowType)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt"> 
            oid=3f01b3de-7a1c-4ab5-9735-e2cd8ed6e108, version=null<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">   
            objectClass: {...resource/instance-3}csAccount<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">   
            resourceRef:
            oid=a343fc2e-3954-4034-ba1a-2b72c21e577a(ResourceType)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">    kind:
            ACCOUNT<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">    intent:
            default<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">   
            attributes:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">        pid:
            017<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">   
            iteration: 0<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">   
            iterationToken: .<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">com.evolveum.midpoint.util.exception.SchemaException:
            Could not determine shadow name.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.schema.util.ShadowUtil.determineShadowStringName(ShadowUtil.java:695)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.schema.util.ShadowUtil.determineShadowName(ShadowUtil.java:667)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.LensUtil.createObjectDeltaOperation(LensUtil.java:911)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.executor.DeltaExecution.addToExecutedDeltas(DeltaExecution.java:362)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.executor.DeltaExecution.execute(DeltaExecution.java:174)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.executor.ProjectionChangeExecution.execute(ProjectionChangeExecution.java:129)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeProjectionsChanges(ChangeExecutor.java:98)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeChanges(ChangeExecutor.java:61)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkClick.lambda$processSecondary$0(ClockworkClick.java:229)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:343)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkClick.processSecondary(ClockworkClick.java:227)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkClick.moveStateForward(ClockworkClick.java:194)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkClick.click(ClockworkClick.java:118)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.Clockwork.click(Clockwork.java:382)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.Clockwork.runWithConflictDetection(Clockwork.java:150)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.Clockwork.run(Clockwork.java:104)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.controller.ModelController.executeChangesNonRaw(ModelController.java:444)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.controller.ModelController.executeChanges(ModelController.java:405)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.gui.impl.page.admin.ProgressAwareChangesExecutorImpl$1.callWithContextPrepared(ProgressAwareChangesExecutorImpl.java:148)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.gui.impl.page.admin.ProgressAwareChangesExecutorImpl$1.callWithContextPrepared(ProgressAwareChangesExecutorImpl.java:133)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.web.component.SecurityContextAwareCallable.call(SecurityContextAwareCallable.java:50)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
            java.base/java.lang.Thread.run(Thread.java:829)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">15:12:31.598
            [pool-3-thread-15] ERROR
            c.e.midpoint.model.impl.lens.LensProjectionContext -
            Couldn't determine shadow name for
            shadow:3f01b3de-7a1c-4ab5-9735-e2cd8ed6e108(null).<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">com.evolveum.midpoint.util.exception.SchemaException:
            Could not determine shadow name.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.schema.util.ShadowUtil.determineShadowStringName(ShadowUtil.java:695)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.schema.util.ShadowUtil.determineShadowName(ShadowUtil.java:667)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.LensProjectionContext.resolveNameIfKnown(LensProjectionContext.java:1529)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.LensContext.lambda$getNameResolver$1(LensContext.java:1740)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.common.util.AuditHelper.lambda$resolveNamesInDeltas$0(AuditHelper.java:117)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.schema.util.ObjectDeltaSchemaLevelUtil.lambda$resolveNames$0(ObjectDeltaSchemaLevelUtil.java:68)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.prism.impl.PrismValueImpl.accept(PrismValueImpl.java:192)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.prism.impl.PrismReferenceValueImpl.accept(PrismReferenceValueImpl.java:731)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.prism.impl.delta.ItemDeltaImpl.accept(ItemDeltaImpl.java:176)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.prism.impl.delta.ObjectDeltaImpl.accept(ObjectDeltaImpl.java:99)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.prism.impl.delta.ObjectDeltaImpl.accept(ObjectDeltaImpl.java:89)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.schema.util.ObjectDeltaSchemaLevelUtil.resolveNames(ObjectDeltaSchemaLevelUtil.java:83)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.common.util.AuditHelper.resolveNamesInDeltas(AuditHelper.java:140)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.common.util.AuditHelper.audit(AuditHelper.java:87)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkAuditHelper.auditEvent(ClockworkAuditHelper.java:215)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkAuditHelper.audit(ClockworkAuditHelper.java:78)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkClick.processSecondary(ClockworkClick.java:235)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkClick.moveStateForward(ClockworkClick.java:194)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.ClockworkClick.click(ClockworkClick.java:118)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.Clockwork.click(Clockwork.java:382)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.Clockwork.runWithConflictDetection(Clockwork.java:150)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.lens.Clockwork.run(Clockwork.java:104)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.controller.ModelController.executeChangesNonRaw(ModelController.java:444)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.model.impl.controller.ModelController.executeChanges(ModelController.java:405)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.gui.impl.page.admin.ProgressAwareChangesExecutorImpl$1.callWithContextPrepared(ProgressAwareChangesExecutorImpl.java:148)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.gui.impl.page.admin.ProgressAwareChangesExecutorImpl$1.callWithContextPrepared(ProgressAwareChangesExecutorImpl.java:133)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
com.evolveum.midpoint.web.component.SecurityContextAwareCallable.call(SecurityContextAwareCallable.java:50)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt">          at
            java.base/java.lang.Thread.run(Thread.java:829)<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
        <div style="border:none;border-top:solid #B5C4DF
          1.0pt;padding:3.0pt 0in 0in 0in">
          <p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
                style="font-size:12.0pt;color:black">From:
              </span></b><span style="font-size:12.0pt;color:black">Pavol
              Mederly <a class="moz-txt-link-rfc2396E" href="mailto:mederly@evolveum.com"><mederly@evolveum.com></a><br>
              <b>Date: </b>Thursday, July 7, 2022 at 9:23 AM<br>
              <b>To: </b>Wang, Xiaoshu <a class="moz-txt-link-rfc2396E" href="mailto:xiaoshuw@email.unc.edu"><xiaoshuw@email.unc.edu></a>,
              midPoint General Discussion
              <a class="moz-txt-link-rfc2396E" href="mailto:midPoint@lists.evolveum.com"><midPoint@lists.evolveum.com></a><br>
              <b>Subject: </b>Re: [midPoint] Couldn't determine shadow
              name<o:p></o:p></span></p>
        </div>
        <p>That's great. I am now not sure - have you implemented a
          (limited) executeQuery method that would allow midPoint to
          fetch your resource objects "by UID"?<o:p></o:p></p>
        <p>Also, I become more and more interested to see the stack
          trace of the "SchemaException" you mentioned. :) I would like
          to know the path between points 3 and 4 in your description
          below, i.e. creating an object and trying to determine its
          name.<o:p></o:p></p>
        <p>Best regards,<o:p></o:p></p>
        <pre>-- <o:p></o:p></pre>
        <pre>Pavol Mederly<o:p></o:p></pre>
        <pre>Software developer<o:p></o:p></pre>
        <pre>evolveum.com<o:p></o:p></pre>
        <div>
          <p class="MsoNormal">On 07/07/2022 15:19, Wang, Xiaoshu wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="font-size:16.0pt">Yes, I can
              execute a single query given a UID.
            </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="font-size:16.0pt">Xiaoshu</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
                  style="font-size:12.0pt;color:black">From:
                </span></b><span style="font-size:12.0pt;color:black">midPoint
                <a href="mailto:midpoint-bounces@lists.evolveum.com"
                  moz-do-not-send="true">
                  <midpoint-bounces@lists.evolveum.com></a> on
                behalf of Pavol Mederly via midPoint
                <a href="mailto:midpoint@lists.evolveum.com"
                  moz-do-not-send="true"><midpoint@lists.evolveum.com></a><br>
                <b>Date: </b>Thursday, July 7, 2022 at 6:32 AM<br>
                <b>To: </b><a href="mailto:midPoint@lists.evolveum.com"
                  moz-do-not-send="true" class="moz-txt-link-freetext">midPoint@lists.evolveum.com</a>
                <a href="mailto:midPoint@lists.evolveum.com"
                  moz-do-not-send="true"><midPoint@lists.evolveum.com></a><br>
                <b>Cc: </b>Pavol Mederly <a
                  href="mailto:mederly@evolveum.com"
                  moz-do-not-send="true"><mederly@evolveum.com></a><br>
                <b>Subject: </b>Re: [midPoint] Couldn't determine
                shadow name</span><o:p></o:p></p>
          </div>
          <p>Hello Xiaoshu,<o:p></o:p></p>
          <p>OK, I understand that you cannot execute a "blank" query
            that would return all objects on a resource. But can you
            execute - at least - a query for one specific object,
            identified by UID?<o:p></o:p></p>
          <p>--<o:p></o:p></p>
          <p>Just by the way, could you share the whole stack trace of
            the "SchemaException: Could not determine shadow name"? I am
            quite interested in the whole execution path there. And, the
            exact midPoint version.<o:p></o:p></p>
          <p>Best regards,<o:p></o:p></p>
          <pre>-- <o:p></o:p></pre>
          <pre>Pavol Mederly<o:p></o:p></pre>
          <pre>Software developer<o:p></o:p></pre>
          <pre>evolveum.com<o:p></o:p></pre>
          <div>
            <p class="MsoNormal">On 06/07/2022 20:00, Wang, Xiaoshu via
              midPoint wrote:<o:p></o:p></p>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <p class="MsoNormal"><span style="font-size:16.0pt">Pavol:</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt">I am not
                sure how. </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt">The icf
                connector’s create signature is this. And see the
                implementation</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal" style="background:white"><span
                style="font-size:12.0pt;color:black">public Uid
                create(ObjectClass objectClass, Set<Attribute>
                attributes, OperationOptions operationOptions) {</span><o:p></o:p></p>
            <pre style="margin-left:45.8pt;background:white"><span style="font-size:12.0pt;color:black">Optional</span><span style="font-size:12.0pt;color:#3F9101"><</span><span style="font-size:12.0pt;color:black">String</span><span style="font-size:12.0pt;color:#3F9101">> </span><span style="font-size:12.0pt;color:black">pid </span><span style="font-size:12.0pt;color:#080808">= </span><span style="font-size:12.0pt;color:black">CsUtil</span><span style="font-size:12.0pt;color:#080808">.<i>findPid</i></span><span style="font-size:12.0pt;color:#3F9101">(</span><span style="font-size:12.0pt;color:#080808">attributes</span><span style="font-size:12.0pt;color:#3F9101">)</span><span style="font-size:12.0pt;color:#080808">;</span><o:p></o:p></pre>
            <pre style="margin-left:45.8pt;background:white"><span style="font-size:12.0pt;color:#0033B3">if </span><span style="font-size:12.0pt;color:#3F9101">(</span><span style="font-size:12.0pt;color:black">pid</span><span style="font-size:12.0pt;color:#080808">.isPresent</span><span style="font-size:12.0pt;color:#0E4A8E">()</span><span style="font-size:12.0pt;color:#3F9101">) </span><span style="font-size:12.0pt;color:#BCBF01">{</span><o:p></o:p></pre>
            <pre style="margin-left:45.8pt;background:white"><span style="font-size:12.0pt;color:#BCBF01">    </span><i><span style="font-size:12.0pt;color:#871094">LOG</span></i><span style="font-size:12.0pt;color:#080808">.info</span><span style="font-size:12.0pt;color:#0E4A8E">(</span><span style="font-size:12.0pt;color:#067D17">">>> Done CsCreate.create"</span><span style="font-size:12.0pt;color:#0E4A8E">)</span><span style="font-size:12.0pt;color:#080808">;</span><o:p></o:p></pre>
            <pre style="margin-left:45.8pt;background:white"><span style="font-size:12.0pt;color:#080808">    </span><span style="font-size:12.0pt;color:black">Name name </span><span style="font-size:12.0pt;color:#080808">= </span><span style="font-size:12.0pt;color:#0033B3">new </span><span style="font-size:12.0pt;color:#080808">Name</span><span style="font-size:12.0pt;color:#0E4A8E">(</span><span style="font-size:12.0pt;color:black">pid</span><span style="font-size:12.0pt;color:#080808">.get</span><span style="font-size:12.0pt;color:#BCBF01">()</span><span style="font-size:12.0pt;color:#0E4A8E">)</span><span style="font-size:12.0pt;color:#080808">;</span><o:p></o:p></pre>
            <pre style="margin-left:45.8pt;background:white"><span style="font-size:12.0pt;color:#080808">    </span><span style="font-size:12.0pt;color:black">Uid uid </span><span style="font-size:12.0pt;color:#080808">= </span><span style="font-size:12.0pt;color:#0033B3">new </span><span style="font-size:12.0pt;color:#080808">Uid</span><span style="font-size:12.0pt;color:#0E4A8E">(</span><span style="font-size:12.0pt;color:black">pid</span><span style="font-size:12.0pt;color:#080808">.get</span><span style="font-size:12.0pt;color:#BCBF01">()</span><span style="font-size:12.0pt;color:#080808">, </span><span style="font-size:12.0pt;color:black">name</span><span style="font-size:12.0pt;color:#0E4A8E">)</span><span style="font-size:12.0pt;color:#080808">;</span><o:p></o:p></pre>
            <pre style="margin-left:45.8pt;background:white"><span style="font-size:12.0pt;color:#080808">    </span><span style="font-size:12.0pt;color:#0033B3">return </span><span style="font-size:12.0pt;color:black">uid</span><span style="font-size:12.0pt;color:#080808">;</span><o:p></o:p></pre>
            <pre style="margin-left:45.8pt;background:white"><span style="font-size:12.0pt;color:#BCBF01">} </span><span style="font-size:12.0pt;color:#0033B3">else </span><span style="font-size:12.0pt;color:#BCBF01">{</span><o:p></o:p></pre>
            <pre style="margin-left:45.8pt;background:white"><span style="font-size:12.0pt;color:#BCBF01">    </span><span style="font-size:12.0pt;color:#0033B3">throw new </span><span style="font-size:12.0pt;color:#080808">IllegalArgumentException</span><span style="font-size:12.0pt;color:#0E4A8E">(</span><span style="font-size:12.0pt;color:#067D17">"Cannot create because PID is empty"</span><span style="font-size:12.0pt;color:#0E4A8E">)</span><span style="font-size:12.0pt;color:#080808">;</span><o:p></o:p></pre>
            <pre style="margin-left:45.8pt;background:white"><span style="font-size:12.0pt;color:#BCBF01">}</span><o:p></o:p></pre>
            <p class="MsoNormal" style="background:white"><span
                style="font-size:12.0pt;color:black">}</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt">I can
                only return a Uid object. Providing the nameHint seems
                have no effect.</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt">Most
                “standard” resource will go through the executeQuery
                method (e.g, through an inititial import).</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal" style="background:white"><span
                style="font-size:12.0pt;color:black">public void
                executeQuery(ObjectClass objectClass, PersonSearch
                personSearch, ResultsHandler resultsHandler,
                OperationOptions operationOptions) {</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt">Here,
                you can construct a connectorObject and ask the
                resultHandler to handle it. So, I can set both uid and
                name to whatever I want.
              </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt">But,
                because my resource cannot do the blank query so the
                midpoint will call the create method when needed. But
                the create() is unaware of connectorObject, it only
                returns a unique handle, i.e., the UID.
              </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt">What I
                guess is this.</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <ol style="margin-top:0in" type="1" start="1">
              <li class="MsoListParagraph"
                style="margin-left:0in;mso-list:l0 level1 lfo3"><span
                  style="font-size:16.0pt">A property-change triggers an
                  outbound mapping</span><o:p></o:p></li>
              <li class="MsoListParagraph"
                style="margin-left:0in;mso-list:l0 level1 lfo3"><span
                  style="font-size:16.0pt">Midpoint notices the absence
                  of a shadow account for the outbound resource</span><o:p></o:p></li>
              <li class="MsoListParagraph"
                style="margin-left:0in;mso-list:l0 level1 lfo3"><span
                  style="font-size:16.0pt">Midpoint called the
                  connector.create() method to create the intended
                  resource and subsequently create the shadowObject with
                  the returned uid.</span><o:p></o:p></li>
              <li class="MsoListParagraph"
                style="margin-left:0in;mso-list:l0 level1 lfo3"><span
                  style="font-size:16.0pt">At a later stage, it triggers
                  the ShadowUtil.determineShadowName method and throw an
                  exception when found absent.</span><o:p></o:p></li>
            </ol>
            <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt">A
                potential remedy is step #3, when midpoint can use the
                nameHint of the Uid object to fill in the name of the
                shadow account.</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="font-size:16.0pt">Xiaoshu</span><o:p></o:p></p>
            <div style="border:none;border-top:solid #B5C4DF
              1.0pt;padding:3.0pt 0in 0in 0in">
              <p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
                    style="font-size:12.0pt;color:black">From:
                  </span></b><span style="font-size:12.0pt;color:black">midPoint
                  <a href="mailto:midpoint-bounces@lists.evolveum.com"
                    moz-do-not-send="true">
                    <midpoint-bounces@lists.evolveum.com></a> on
                  behalf of Pavol Mederly via midPoint
                  <a href="mailto:midpoint@lists.evolveum.com"
                    moz-do-not-send="true"><midpoint@lists.evolveum.com></a><br>
                  <b>Date: </b>Wednesday, July 6, 2022 at 1:35 PM<br>
                  <b>To: </b><a
                    href="mailto:midpoint@lists.evolveum.com"
                    moz-do-not-send="true" class="moz-txt-link-freetext">midpoint@lists.evolveum.com</a>
                  <a href="mailto:midpoint@lists.evolveum.com"
                    moz-do-not-send="true"><midpoint@lists.evolveum.com></a><br>
                  <b>Cc: </b>Pavol Mederly <a
                    href="mailto:mederly@evolveum.com"
                    moz-do-not-send="true"><mederly@evolveum.com></a><br>
                  <b>Subject: </b>Re: [midPoint] Couldn't determine
                  shadow name</span><o:p></o:p></p>
            </div>
            <p>Hello Xiaoshu,<o:p></o:p></p>
            <p>I am still not sure I completely understand your use
              case, but maybe the simplest thing your connector can do
              is to mirror __UID__ to __NAME__ itself (if the name is
              not known). This is actually what many connectors do.<o:p></o:p></p>
            <p>See also <a
href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.evolveum.com%2Fconnectors%2Fconnid%2F1.x%2Fconnector-development-guide%2F%23__uid__-and-__name__-are-the-same&data=05%7C01%7C%7Cf10df076c0ab4d91263408da601bcfb2%7C58b3d54f16c942d3af081fcabd095666%7C1%7C0%7C637927969823060003%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2dxaENoPuGwfljm9jgLK9cgg1ZA9BxNk57l%2Fm%2F%2BNVPI%3D&reserved=0"
                moz-do-not-send="true">
https://docs.evolveum.com/connectors/connid/1.x/connector-development-guide/#__uid__-and-__name__-are-the-same</a>.<o:p></o:p></p>
            <p>I am not sure why both of these are obligatory in ConnId
              (originally ICF, then OpenICF).<o:p></o:p></p>
            <p>The <span style="font-family:"Courier New"">ShadowUtil.determineShadowName</span>
              method is maybe not very consistent, I must admit. (I have
              looked at it right now.) For example, it is called from a
              couple of places in midPoint, and a caller usually catches
              SchemaException, and continues with "no name" situation. I
              am not sure about your specific situation, because I don't
              know exact midPoint version, whole stack trace, and so on.
              But I think the best you can do is simply to return both
              __UID__ and __NAME__ from your connector, and (hopefully)
              midPoint will be happy with it.<o:p></o:p></p>
            <p>Best regards,<o:p></o:p></p>
            <pre>-- <o:p></o:p></pre>
            <pre>Pavol Mederly<o:p></o:p></pre>
            <pre>Software developer<o:p></o:p></pre>
            <pre>evolveum.com<o:p></o:p></pre>
            <div>
              <p class="MsoNormal">On 06/07/2022 17:34, Wang, Xiaoshu
                via midPoint wrote:<o:p></o:p></p>
            </div>
            <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
              <p class="MsoNormal"><span style="font-size:16.0pt">Pavol:</span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt">Conceptually,
                  I know “why” it throws the exception but I wonder if
                  it can be considered as a “bug” or “improvement” for
                  the midpoint.</span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt">I have
                  a particular use case, where I have a resource that I
                  only need to do outbound mapping. The resource,
                  however, does not provide an API for me to do
                  something like getAll() operations. In other words, I
                  cannot do an initial import kind of task to force
                  midpoint to create all the shadow account.</span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt">Thus,
                  when a property change that triggers an outbound
                  mapping, midpoint noted that the resource does not
                  exist, so it calls the create() method on the
                  connector. Unlike the executeQuery method, which can
                  construct a connectorObject and ask midpoint to handle
                  it. The create method can only return a “Uid”. I
                  understand the rational under this as the
                  connector.create() is meant to create a remote
                  resource as opposed to create the shadow account, (I
                  guess is mirrored by the connectorObject). Upon
                  receiving the UID, the midpoint then creates a
                  matching shadow account with it (due to the absence of
                  it). However, as both __UID__ and __NAME__ are *<b>required</b>*
                  attributes for a connectorObject (i.e., shadow
                  account), then a later verification step failed the
                  check and throws the exception.</span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt">The
                  exception appears non-preemptive, i.e., it does create
                  the shadow account, which name, I can later fill when
                  the updateDelta is called. The exception trace would
                  be more of a nuance than error. Yet, I think it would
                  be nice that midpoint can do some auto remedy for it.
                  For example, during the validation phase, copy the
                  __uid__ to __name__ if the latter is absent etc.</span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt">Or, if
                  there might be some other way to get around this
                  particular use case of mine, I would be glad to hear
                  it.</span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt">Xiaoshu</span><o:p></o:p></p>
              <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
              <div style="border:none;border-top:solid #B5C4DF
                1.0pt;padding:3.0pt 0in 0in 0in">
                <p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
                      style="font-size:12.0pt;color:black">From:
                    </span></b><span
                    style="font-size:12.0pt;color:black">midPoint <a
                      href="mailto:midpoint-bounces@lists.evolveum.com"
                      moz-do-not-send="true">
                      <midpoint-bounces@lists.evolveum.com></a> on
                    behalf of Pavol Mederly via midPoint
                    <a href="mailto:midpoint@lists.evolveum.com"
                      moz-do-not-send="true"><midpoint@lists.evolveum.com></a><br>
                    <b>Date: </b>Wednesday, July 6, 2022 at 5:10 AM<br>
                    <b>To: </b><a
                      href="mailto:midpoint@lists.evolveum.com"
                      moz-do-not-send="true"
                      class="moz-txt-link-freetext">midpoint@lists.evolveum.com</a>
                    <a href="mailto:midpoint@lists.evolveum.com"
                      moz-do-not-send="true"><midpoint@lists.evolveum.com></a><br>
                    <b>Cc: </b>Pavol Mederly <a
                      href="mailto:mederly@evolveum.com"
                      moz-do-not-send="true"><mederly@evolveum.com></a><br>
                    <b>Subject: </b>Re: [midPoint] Couldn't determine
                    shadow name</span><o:p></o:p></p>
              </div>
              <p>Hi Xiaoshu,<o:p></o:p></p>
              <p>I always recommend to have a look at the code that
                throws the exception. In your case it's most probably
                this one:<o:p></o:p></p>
              <p><a
href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FEvolveum%2Fmidpoint%2Fblob%2Fd317537626a99db32764c486507f1c1ac5a47fb6%2Finfra%2Fschema%2Fsrc%2Fmain%2Fjava%2Fcom%2Fevolveum%2Fmidpoint%2Fschema%2Futil%2FShadowUtil.java%23L688-L736&data=05%7C01%7C%7Cf10df076c0ab4d91263408da601bcfb2%7C58b3d54f16c942d3af081fcabd095666%7C1%7C0%7C637927969823060003%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fZ21g8ptR60mCiYL2SEsk5nYH05Mynt1Xf7NCePmexo%3D&reserved=0"
                  moz-do-not-send="true">https://github.com/Evolveum/midpoint/blob/d317537626a99db32764c486507f1c1ac5a47fb6/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ShadowUtil.java#L688-L736</a><o:p></o:p></p>
              <p>(lines are shifted probably because of midPoint version
                mismatch)<o:p></o:p></p>
              <p>It should give you a clue - e.g. does your object have
                a primary identifier set? Etc...<o:p></o:p></p>
              <p>Regards,<o:p></o:p></p>
              <pre>-- <o:p></o:p></pre>
              <pre>Pavol Mederly<o:p></o:p></pre>
              <pre>Software developer<o:p></o:p></pre>
              <pre>evolveum.com<o:p></o:p></pre>
              <div>
                <p class="MsoNormal">On 23/06/2022 15:27, Wang, Xiaoshu
                  via midPoint wrote:<o:p></o:p></p>
              </div>
              <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
                <p class="MsoNormal"><span style="font-size:16.0pt">Hi,</span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt">I am
                    developing a custom connector. When I assign the
                    resource connected with that connector, I got the
                    following exception.</span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt">com.evolveum.midpoint.util.exception.SchemaException:
                    Could not determine shadow name.</span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt">         
                    at
com.evolveum.midpoint.schema.util.ShadowUtil.determineShadowStringName(ShadowUtil.java:695)</span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt">         
                    at
com.evolveum.midpoint.schema.util.ShadowUtil.determineShadowName(ShadowUtil.java:667)</span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt">         
                    ….</span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt">The
                    exception seems not do anything “harmful” as far as
                    I can tell because the new account would be listed
                    under the resource. But I want to know why. Hope
                    someone can shed some light on for me.</span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt"> </span><o:p></o:p></p>
                <p class="MsoNormal"><span style="font-size:16.0pt">Xiaoshu</span><o:p></o:p></p>
                <p class="MsoNormal"><br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <o:p></o:p></p>
                <pre>_______________________________________________<o:p></o:p></pre>
                <pre>midPoint mailing list<o:p></o:p></pre>
                <pre><a href="mailto:midPoint@lists.evolveum.com" moz-do-not-send="true" class="moz-txt-link-freetext">midPoint@lists.evolveum.com</a><o:p></o:p></pre>
                <pre><a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.evolveum.com%2Fmailman%2Flistinfo%2Fmidpoint&data=05%7C01%7C%7Cf10df076c0ab4d91263408da601bcfb2%7C58b3d54f16c942d3af081fcabd095666%7C1%7C0%7C637927969823060003%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JwVUZv5V31TZFvezi%2Bsz0izk6kbsb1SNFO%2BqXhwMu%2F0%3D&reserved=0" moz-do-not-send="true">https://lists.evolveum.com/mailman/listinfo/midpoint</a><o:p></o:p></pre>
              </blockquote>
              <p class="MsoNormal"><br>
                <br>
                <br>
                <br>
                <o:p></o:p></p>
              <pre>_______________________________________________<o:p></o:p></pre>
              <pre>midPoint mailing list<o:p></o:p></pre>
              <pre><a href="mailto:midPoint@lists.evolveum.com" moz-do-not-send="true" class="moz-txt-link-freetext">midPoint@lists.evolveum.com</a><o:p></o:p></pre>
              <pre><a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.evolveum.com%2Fmailman%2Flistinfo%2Fmidpoint&data=05%7C01%7C%7Cf10df076c0ab4d91263408da601bcfb2%7C58b3d54f16c942d3af081fcabd095666%7C1%7C0%7C637927969823060003%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JwVUZv5V31TZFvezi%2Bsz0izk6kbsb1SNFO%2BqXhwMu%2F0%3D&reserved=0" moz-do-not-send="true">https://lists.evolveum.com/mailman/listinfo/midpoint</a><o:p></o:p></pre>
            </blockquote>
            <p class="MsoNormal"><br>
              <br>
              <br>
              <o:p></o:p></p>
            <pre>_______________________________________________<o:p></o:p></pre>
            <pre>midPoint mailing list<o:p></o:p></pre>
            <pre><a href="mailto:midPoint@lists.evolveum.com" moz-do-not-send="true" class="moz-txt-link-freetext">midPoint@lists.evolveum.com</a><o:p></o:p></pre>
            <pre><a href="https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.evolveum.com%2Fmailman%2Flistinfo%2Fmidpoint&data=05%7C01%7C%7Cf10df076c0ab4d91263408da601bcfb2%7C58b3d54f16c942d3af081fcabd095666%7C1%7C0%7C637927969823060003%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JwVUZv5V31TZFvezi%2Bsz0izk6kbsb1SNFO%2BqXhwMu%2F0%3D&reserved=0" moz-do-not-send="true">https://lists.evolveum.com/mailman/listinfo/midpoint</a><o:p></o:p></pre>
          </blockquote>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>