[midPoint] RawType conversion error

Pavol Mederly mederly at evolveum.com
Thu Mar 9 17:17:26 CET 2017


Ana,

I see that nobody seems to have an idea. It's quite hard to help you 
with this, because model-client was designed to be used separately from 
the other midPoint components. (Perhaps we should revisit that decision 
in the future.)

What comes to my mind is this: you could extract only the relevant 
classes (e.g. ProtectedStringType etc) into separate module, and use 
that one within your project. Would that help you?

Best regards,

Pavol Mederly
Software developer
evolveum.com

On 07.03.2017 15:31, Ana Pereyra wrote:
> Hi All,
>
> I bring this up again because we are performing tests with another 
> scenario and faced an issue related to this one.
>
> We have a project that needs to consume data from midpoint users, and 
> that's why its pom has a dependency for the *client-model* artifact.
>
> One of the user attributes need to be decrypted, and for that, we need 
> classes that are included in the *prism *artifact. We add the 
> dependency to the pom (model-client dependency first, then prism 
> dependency) and somehow the /ItemDeltaType /class gets overwritten and 
> we loose some some methods or get the same methods with different 
> definitions (RawType issue referenced in previous messages in this 
> thread).
>
> If we switch the order of the dependencies in the pom file (prism 
> first, then model-client dependency) we get the same issue but this 
> time, we loose the definition of /ProtectedStringType /class and 
> /ProtectedDataType /class.
>
> Any ideas why this happens or how to prevent this overwriting issue 
> from occurring?
>
> Thanks in advance
> Regards
>
> 2017-01-10 14:52 GMT-03:00 Ana Pereyra <apereyra at identicum.com 
> <mailto:apereyra at identicum.com>>:
>
>     Hi Pavol,
>
>     Thanks for answering. We were having trouble with this, but it's
>     working now. In our test, we had a midpoint project, with an
>     overlay that extended the admin-gui. In that context, we thought
>     it should work, but had that conversion type error.
>
>     What we ended up doing, was creating a new project, adding the
>     model-client dependency to the pom file and it worked.
>
>     Thanks a lot for your time!
>     Regards,
>
>     2017-01-09 10:03 GMT-03:00 Pavol Mederly <mederly at evolveum.com
>     <mailto:mederly at evolveum.com>>:
>
>         Hello Ana.
>
>         This is really strange. I've tested your scenario with both
>         midPoint 3.4.1 and master (3.6-snapshot, almost equal to 3.5),
>         and it works:
>
>         "Endpoint URL: http://localhost:8080/midpoint/model/model-3
>         <http://localhost:8080/midpoint/model/model-3>
>         Got system configuration
>         Got administrator user: 00000000-0000-0000-0000-000000000002
>         Got Sailor role
>         Resources (0)
>         Users (1)
>         Tasks (3)
>         Created user guybrush, OID: 9baf4217-47ec-4792-805a-a9e7f6c6145a
>         Fetched user guybrush:
>         Users fullName: Guybrush Threepwood
>         Created user lechuck, OID: c0c010c0-d34d-b33f-f00d-11111111ec1e
>         Changed user password
>         Changed user given name
>         Assigned roles
>         Unassigned roles
>         Found 0 requestable roles
>         Created role Sea Superuser, OID:
>         b77019b2-6a45-4d41-aff6-6041acc748b8
>         Assigned role Sea Superuser to LeChuck
>         Modified role Sea Superuser - modified resource inducement
>         Modified role Sea Superuser - changed role inducement
>         LeChuck reconciled.
>         Deleted user(s)
>
>         Process finished with exit code 0"
>
>         Are you sure you use correct versions of the Java code? I.e.
>         either both 3.4.x or 3.5 (or master)?
>
>         Pavol Mederly
>         Software developer
>         evolveum.com <http://evolveum.com>
>
>         On 05.01.2017 19:52, Ana Pereyra wrote:
>>         Hi everyone.
>>
>>         I'm trying to build a client using the model-client-sample
>>         example in Github.
>>
>>         The issue I'm having is with line 339 of class Main
>>         (https://github.com/Evolveum/midpoint/blob/v3.4.1/samples/model-client-sample/src/main/java/com/evolveum/midpoint/testing/model/client/sample/Main.java
>>         <https://github.com/Evolveum/midpoint/blob/v3.4.1/samples/model-client-sample/src/main/java/com/evolveum/midpoint/testing/model/client/sample/Main.java>):
>>         the method ItemDeltaType.getValue() returns a list of
>>         RawType, and the ModelClientUtil.createProtectedString()
>>         returns a ProtectedString not compatible with RawType.
>>
>>         Here is the code:
>>
>>             private static void changeUserPassword(ModelPortType
>>             modelPort, String oid, String newPassword) throws
>>             FaultMessage {
>>             ItemDeltaType passwordDelta = new ItemDeltaType();
>>             passwordDelta.setModificationType(ModificationTypeType.REPLACE);
>>             passwordDelta.setPath(ModelClientUtil.createItemPathType("credentials/password/value"));
>>             *passwordDelta.getValue().add(ModelClientUtil.createProtectedString(newPassword));*
>>                     ObjectDeltaType deltaType = new ObjectDeltaType();
>>             deltaType.setObjectType(ModelClientUtil.getTypeQName(UserType.class));
>>             deltaType.setChangeType(ChangeTypeType.MODIFY);
>>                     deltaType.setOid(oid);
>>             deltaType.getItemDelta().add(passwordDelta);
>>                     ObjectDeltaListType deltaListType = new
>>             ObjectDeltaListType();
>>             deltaListType.getDelta().add(deltaType);
>>             modelPort.executeChanges(deltaListType, null);
>>             }
>>
>>
>>         How do I get a RawType from the result of the
>>         *createProtectedString *return type?
>>
>>         Thank you all.
>>         Regards,
>>         -- 
>>         *Ana Pereyra*
>>          Identicum S.A.
>>         /Jorge Newbery 3226, Argentina
>>         Tel: +54 (11) //4552.3050/
>>         /apereyra at identicum.com <mailto:apereyra at identicum.com>/
>>         www.identicum.com <http://www.identicum.com/>
>>
>>
>>         _______________________________________________
>>         midPoint mailing list
>>         midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>>         http://lists.evolveum.com/mailman/listinfo/midpoint
>>         <http://lists.evolveum.com/mailman/listinfo/midpoint>
>         _______________________________________________ midPoint
>         mailing list midPoint at lists.evolveum.com
>         <mailto:midPoint at lists.evolveum.com>
>         http://lists.evolveum.com/mailman/listinfo/midpoint
>         <http://lists.evolveum.com/mailman/listinfo/midpoint> 
>
>     -- 
>     *Ana Pereyra*
>      Identicum S.A. /Jorge Newbery 3226, Argentina Tel: +54 (11)
>     //4552.3050/
>     /apereyra at identicum.com <mailto:apereyra at identicum.com>/
>     www.identicum.com <http://www.identicum.com/>
>
> -- 
> *Ana Pereyra*
>  Identicum S.A. /Jorge Newbery 3226, Argentina Tel: +54 (11) //4552.3050/
> /apereyra at identicum.com <mailto:apereyra at identicum.com>/ 
> www.identicum.com <http://www.identicum.com/>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170309/837568b1/attachment.htm>


More information about the midPoint mailing list