[midPoint] Overriding systemConfiguration attributes in config.xml file or using java system properties

Pavol Mederly mederly at evolveum.com
Tue Dec 10 09:17:57 CET 2019


Hello Fréderic,

there are two distinct concepts:

 1. System Configuration object in midPoint repository,
 2. configuration in config.xml file.

The first one is the "main" one. Here e.g. deployment information (that 
you'd like to change) resides.

The second one is used for low-level information (e.g. where to find the 
repository) or for node-specific information (e.g. node id).

Java system properties can be used to override information in 
config.xml, not in System Configuration object. That's why 
*-Dmidpoint.system.deploymentInformation.name=DEV* does not work.

As far as I know, it is currently not possible to set the deployment 
name from the command line.

The following approach works in similar situations (unfortunately, not 
in this particular one):

https://wiki.evolveum.com/display/midPoint/Configuration+and+Use+of+Constants

You can define a constant in your config.xml file. (So its value is 
settable using -D ... switch.) And you can use this constant in your 
mappings or resource configurations. In the system config it would be 
like this (if it worked):

<deploymentInformation>
         <name>
             <expression>
                 <const>systemName</const>
             </expression>
         </name>
</deploymentInformation>

It's doable, but not there yet. You can always consider 
https://wiki.evolveum.com/display/midPoint/Subscriptions+and+Sponsoring :)

...as for your question on config.xml schema. Unfortunately, nothing 
like that exist yet. We read the file programatically, looking for 
specific keys. Something is here:

  * https://github.com/Evolveum/midpoint/blob/master/infra/common/src/main/java/com/evolveum/midpoint/common/configuration/api/MidpointConfiguration.java
  * https://github.com/Evolveum/midpoint/blob/master/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerConfiguration.java#L52
  * https://github.com/Evolveum/midpoint/blob/master/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryConfiguration.java#L249

but it's not a complete reference.

Best regards,

Pavol Mederly
Software developer
evolveum.com

On 10/12/2019 08:18, Gómez Martínez, Elsa wrote:
>
> Hello!
>
> Have you tried to change midpoint.sh file?
>
> I have to change it to modify the MIDPOINT_PORT because I tried in all 
> of the files and it only worked in midpoint.bat (I’m running in 
> Windows, I suppose it’s the same to Linux.)
>
> Hope it helps.
>
> Elsa
>
> *De:*midPoint <midpoint-bounces at lists.evolveum.com> *En nombre de 
> *Frédéric Lohier
> *Enviado el:* lunes, 9 de diciembre de 2019 18:56
> *Para:* midPoint General Discussion <midpoint at lists.evolveum.com>
> *Asunto:* [midPoint] Overriding systemConfiguration attributes in 
> config.xml file or using java system properties
>
> Hello,
>
> Following my last message, I would like to override 
> systemConfiguration attributes using config.xml or java system 
> properties as explained here 
> https://wiki.evolveum.com/display/midPoint/Overriding+config.xml+parameters
>
> Looking at 
> https://github.com/Evolveum/midpoint/blob/master/infra/common/src/main/java/com/evolveum/midpoint/common/configuration/api/MidpointConfiguration.java
>
> I tried the following in midpoint/bin/setenv.sh
>
> JAVA_OPTS="$JAVA_OPTS
>
> -Dmidpoint.system.deploymentInformation.name 
> <http://dmidpoint.system.deploymentinformation.name/>=DEV”
>
> But it doesn’t work after a restart. Any though of how I could make 
> this work?
>
> -Frederic
>
>
> ------------------------------------------------------------------------
>
> Este correo electrónico y, en su caso, cualquier fichero anexo al 
> mismo, contiene información de carácter confidencial exclusivamente 
> dirigida a su destinatario o destinatarios. Si no es vd. el 
> destinatario indicado, queda notificado que la lectura, utilización, 
> divulgación y/o copia sin autorización está prohibida en virtud de la 
> legislación vigente. En el caso de haber recibido este correo 
> electrónico por error, se ruega notificar inmediatamente esta 
> circunstancia mediante reenvío a la dirección electrónica del remitente.
> Evite imprimir este mensaje si no es estrictamente necesario.
>
> This email and any file attached to it (when applicable) contain(s) 
> confidential information that is exclusively addressed to its 
> recipient(s). If you are not the indicated recipient, you are informed 
> that reading, using, disseminating and/or copying it without 
> authorisation is forbidden in accordance with the legislation in 
> effect. If you have received this email by mistake, please immediately 
> notify the sender of the situation by resending it to their email address.
> Avoid printing this message if it is not absolutely necessary.
>
> _______________________________________________
> 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/20191210/cd0a6dc3/attachment.htm>


More information about the midPoint mailing list