[midPoint] NULL prismContext

Jan Vaňáček - AMI Praha a.s. jan.vanacek at ami.cz
Fri Oct 11 13:01:16 UTC 2019


Hi guys,

I am using midPoint 3.7 support and l am looking into NPE connected with
prismContext and I am a little bit getting frustrated since I have no idea
how to find root cause.



This NPE occurs when computing authorizations for Org tree.

I have an authorization (for deleting subunits):

<authorization>

       <name>*org*-delete-subunit</name>

       <action>
http://midpoint.evolveum.com/xml/ns/public/security/authorization-model-3#delete
</action>

       <object>

             <type>OrgType</type>

             <orgRelation>

                    <subjectRelation>org:manager</subjectRelation>

                    <scope>allDescendants</scope>

                    <includeReferenceOrg>true</includeReferenceOrg>

             </orgRelation>

             <filter>

                    <q:equal>

                           <q:path>orgType</q:path>

                           <q:value>ROLE_FOLDER</q:value>

                    </q:equal>

             </filter>

       </object>

</authorization>



When I click into Org. structure and then I click on any item in a tree
(including root org) authorizations will be computed.

But when it gets to computing root org object. It invokes
object.getPrismContext() which is null resulting in Error 500:
*org.apache.wicket.WicketRuntimeException:
Error attaching this container for rendering: [ListView [Component id =
menuItem]]*



When I try to click (compute) it for the second time it is OK. But then it
occures sometimes again (especially when I log out and log in, but it
depends – sometimes it is just on the 10th attempt, sometimes on the 2nd
attempt)



I noticed that in com.evolveum.midpoint.prism.Item is mentioned: „beware,
this one can easily be null“, but in QueryJaxbConvertor it is not checked
for null…



Is there any way how to make sure that there always be prismContext for a
root org? Or what else should I check?



*Jan Vaňáček*
JAVA programátor

gsm: [+420] 734 510 214
e-mail: jan.vanacek at ami.cz

*AMI Praha a.s.*
Pláničkova 11, 162 00 Praha 6



tel.: [+420] 274 783 239 | web: www.ami.cz



[image: AMI Praha a.s.]



Textem tohoto e‑mailu podepisující neslibuje uzavřít ani neuzavírá
za společnost AMI Praha a.s.
jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně
písemnou formu.

Tento e‑mail je určen výhradně pro potřeby jeho adresáta/ů a může obsahovat
důvěrné nebo osobní
informace. Nejste‑li zamýšleným příjemcem, je zakázáno jakékoliv
zveřejňování, zprostředkování
nebo jiné použití těchto informací. Pokud jste obdrželi e‑mail neoprávněně,
informujte o tom prosím
odesílatele a vymažte neprodleně všechny kopie tohoto e‑mailu včetně
všech jeho příloh. Nakládáním
s neoprávněně získanými informacemi se vystavujete riziku právního postihu.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolveum.com/pipermail/midpoint/attachments/20191011/e2b0b691/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 2900 bytes
Desc: not available
URL: <http://lists.evolveum.com/pipermail/midpoint/attachments/20191011/e2b0b691/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PrismContext.PNG
Type: image/png
Size: 76130 bytes
Desc: not available
URL: <http://lists.evolveum.com/pipermail/midpoint/attachments/20191011/e2b0b691/attachment-0001.png>


More information about the midPoint mailing list